timeago.dart
timeago.dart copied to clipboard
Clock variable is not working
I'm trying to compare time to UTC by passing UTC date but it still take the time from mobile timezone Here is the test
DateTime utcDate = DateTime.now().toUtc(); DateTime serverDate = DateTime.parse(myEntity.publishDate); print("utc date: $utcDate"); print("server date: $serverDate"); print("app timezone date: ${DateTime.now()}"); print("format: ${timeago.format(serverDate, locale: "en",clock: utcDate)}");
and here is the result
utc date: 2019-11-11 15:47:07.547533Z server date: 2019-11-11 15:15:11.626 app timezone date: 2019-11-11 18:47:07.547691 format: 4 hours ago
For me too, any solution for that ?
Nothing yet
I know its an old issue but if you still care about this functionality, see comments of the PR here https://github.com/andresaraujo/timeago.dart/pull/142#issuecomment-859661123
@andresaraujo Thank you so much.
I may consider get back to this package in the future.
because I'm using Jiffy which has "from" function
Jiffy(DateTime.parse(serverDateTime)).from(mobileUTCDateTime)
and it works just fine for such a case.
I know its an old issue but if you still care about this functionality, see comments of the PR here #142 (comment)
worked for me