Skip to content

Commit

Permalink
fix error prone implementation for date
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sidhdhi-p committed Oct 11, 2024
1 parent fd2208a commit e0c1114
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/lib/service/match/match_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class MatchService {
Stream<List<MatchModel>> streamUpcomingMatches() {
final DateTime now = DateTime.now();
final startOfDay = DateTime(now.year, now.month, now.day);
final DateTime aMonthAfter = DateTime(now.year, now.month + 1, now.day);
final DateTime aMonthAfter = startOfDay.add(Duration(days: 30));

final Timestamp timestampAfterMonth = Timestamp.fromDate(aMonthAfter);
final Timestamp timestampNow = Timestamp.fromDate(startOfDay);
Expand Down Expand Up @@ -461,7 +461,7 @@ class MatchService {
transaction.update(
matchRef,
{
FireStoreConst.teams: updatedTeams.map((e) => e.toJson()),
FireStoreConst.teams: updatedTeams.map((e) => e.toJson()).toList(),
FireStoreConst.updatedAt: DateTime.now(),
},
);
Expand Down

0 comments on commit e0c1114

Please sign in to comment.