Skip to content

Commit

Permalink
feat: allow to register an event for today
Browse files Browse the repository at this point in the history
  • Loading branch information
gion-andri committed May 30, 2024
1 parent 0536340 commit eef6698
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/shared/utils/dates.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export class DatesUtil {
}

const dateObj = dayjs(input, "YYYY-MM-DD");
if (dateObj.isBefore(dayjs())) {
const now = dayjs();
const lastMidnight = now.startOf('day');
if (dateObj.isBefore(lastMidnight)) {
return 'past';
}

Expand Down

0 comments on commit eef6698

Please sign in to comment.