Removed useless code

This commit is contained in:
Juan Gilsanz Polo 2022-11-24 11:26:35 +01:00
parent 19b6a571c6
commit 6109b9982e
3 changed files with 3 additions and 18 deletions

View file

@ -13,21 +13,6 @@ String formatTimestampUTC(DateTime timestamp, String format) {
return dateFormat.format(DateTime.parse(localDate));
}
String formatTimestampUTCFromAPI(DateTime timestamp, String format) {
final DateFormat dateFormat = DateFormat(format);
final DateTime date = DateTime(
timestamp.year,
timestamp.month,
timestamp.day,
timestamp.hour,
timestamp.minute,
timestamp.second
);
final String utcDate = dateFormat.format(DateTime.parse(date.toString()));
final String localDate = dateFormat.parse(utcDate, true).toLocal().toIso8601String();
return dateFormat.format(DateTime.parse(localDate));
}
String formatTimeOfDay(TimeOfDay timestamp, String format) {
DateFormat f = DateFormat(format);
return f.format(DateTime(0, 0, 0, timestamp.hour, timestamp.minute));

View file

@ -155,7 +155,7 @@ class LogDetailsScreen extends StatelessWidget {
LogListTile(
icon: Icons.schedule,
title: AppLocalizations.of(context)!.time,
subtitle: formatTimestampUTCFromAPI(log.time, 'HH:mm:ss')
subtitle: formatTimestampUTC(log.time, 'HH:mm:ss')
),
SectionLabel(label: AppLocalizations.of(context)!.request),
LogListTile(

View file

@ -123,7 +123,7 @@ class LogTile extends StatelessWidget {
const SizedBox(width: 5),
SizedBox(
child: Text(
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss'),
formatTimestampUTC(log.time, 'HH:mm:ss'),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).listTileTheme.textColor,
@ -190,7 +190,7 @@ class LogTile extends StatelessWidget {
const SizedBox(width: 15),
SizedBox(
child: Text(
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss'),
formatTimestampUTC(log.time, 'HH:mm:ss'),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).listTileTheme.textColor,