mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
14 lines
352 B
TypeScript
14 lines
352 B
TypeScript
import moment from 'moment';
|
|
|
|
/**
|
|
* Given a snoozed unix timestamp in seconds, returns the number of days since
|
|
* the prompt was snoozed.
|
|
*
|
|
* @param snoozedTs Snoozed timestamp
|
|
*/
|
|
export function snoozedDays(snoozedTs: number) {
|
|
const now = moment.utc();
|
|
const snoozedOn = moment.unix(snoozedTs).utc();
|
|
return now.diff(snoozedOn, 'days');
|
|
}
|