This commit is contained in:
parent
be19ad1833
commit
4cbe227827
@ -34,7 +34,13 @@ export function timeAgo(input: Date | number) {
|
|||||||
* @param date the date
|
* @param date the date
|
||||||
*/
|
*/
|
||||||
export function getMidnightAlignedDate(date: Date) {
|
export function getMidnightAlignedDate(date: Date) {
|
||||||
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
const midnightDate = new Date(
|
||||||
|
date.getFullYear(),
|
||||||
|
date.getMonth(),
|
||||||
|
date.getDate(),
|
||||||
|
);
|
||||||
|
midnightDate.setUTCHours(0, 0, 0, 0);
|
||||||
|
return midnightDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user