promptsActivity.tsx 354 B

12345678910111213
  1. import moment from 'moment';
  2. /**
  3. * Given a snoozed unix timestamp in seconds, returns the number of days since
  4. * the prompt was snoozed.
  5. *
  6. * @param snoozedTs Snoozed timestamp
  7. */
  8. export function snoozedDays(snoozedTs: number) {
  9. const now = moment.utc();
  10. const snoozedDay = moment.unix(snoozedTs).utc();
  11. return now.diff(snoozedDay, 'days');
  12. }