Skip to content

Commit

Permalink
😑 force timestamp instead of dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
yelkamel committed Oct 23, 2023
1 parent b6308f5 commit 81d024d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/jsonconverter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ class FirestoreListDateTimeConverter
extends JsonConverter<List<DateTime>, List<Timestamp>> {
const FirestoreListDateTimeConverter();
@override
List<DateTime> fromJson(List<dynamic> json) => json.map((e) {
if (e is Timestamp)
return DateTime.fromMillisecondsSinceEpoch(e.millisecondsSinceEpoch);
return DateTime.fromMillisecondsSinceEpoch(0);
List<DateTime> fromJson(List<Timestamp> json) => json.map((e) {
return DateTime.fromMillisecondsSinceEpoch(e.millisecondsSinceEpoch);
}).toList();

@override
Expand Down

0 comments on commit 81d024d

Please sign in to comment.