mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
12 lines
374 B
TypeScript
12 lines
374 B
TypeScript
import moment from 'moment';
|
|
|
|
export function getDaysSinceDatePrecise(date: string) {
|
|
const dateWithTime = moment(date).utc();
|
|
return moment().utc().diff(dateWithTime, 'days', true);
|
|
}
|
|
|
|
export default function getDaysSinceDate(date: string) {
|
|
const dateWithTime = moment(date).utc().startOf('day');
|
|
return moment().utc().startOf('day').diff(dateWithTime, 'days');
|
|
}
|