Use isSameDay and isToday utilities

This commit is contained in:
Evan Hahn 2022-02-02 12:27:44 -06:00 committed by GitHub
parent 2f1d47c79e
commit 07968ea42b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 19 deletions

View file

@ -31,10 +31,10 @@ export function toDayMillis(timestamp: number): number {
return timestamp - (timestamp % DAY);
}
const isSameDay = (a: RawTimestamp, b: RawTimestamp): boolean =>
export const isSameDay = (a: RawTimestamp, b: RawTimestamp): boolean =>
moment(a).isSame(b, 'day');
const isToday = (rawTimestamp: RawTimestamp): boolean =>
export const isToday = (rawTimestamp: RawTimestamp): boolean =>
isSameDay(rawTimestamp, Date.now());
const isYesterday = (rawTimestamp: RawTimestamp): boolean =>