Use isSameDay
and isToday
utilities
This commit is contained in:
parent
2f1d47c79e
commit
07968ea42b
4 changed files with 61 additions and 19 deletions
|
@ -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 =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue