File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,20 @@ class RacesList extends StatelessWidget {
328328 return DateTime .now ().millisecondsSinceEpoch.remainder (100000 );
329329 }
330330
331+ // From https://stackoverflow.com/a/58711821
332+ String formattedTimeZoneOffset (DateTime time) {
333+ String twoDigits (int n) {
334+ if (n >= 10 ) return '$n ' ;
335+ return '0$n ' ;
336+ }
337+
338+ final duration = time.timeZoneOffset,
339+ hours = duration.inHours,
340+ minutes = duration.inMinutes.remainder (60 ).abs ().toInt ();
341+
342+ return '${hours > 0 ? '+' : '-' }${twoDigits (hours .abs ())}:${twoDigits (minutes )}' ;
343+ }
344+
331345 Future <void > scheduledNotification (String meetingId) async {
332346 List <NotificationModel > notifications =
333347 await AwesomeNotifications ().listScheduledNotifications ();
@@ -363,7 +377,7 @@ class RacesList extends StatelessWidget {
363377 hour: sessionDate.hour,
364378 day: sessionDate.day,
365379 month: sessionDate.month,
366- timeZone: 'GMT${session [ 'gmtOffset' ] }' ,
380+ timeZone: 'GMT${formattedTimeZoneOffset ( DateTime . now ()) }' ,
367381 ),
368382 );
369383 }
You can’t perform that action at this time.
0 commit comments