-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Description
Line 10 in 15bce03
| "date-fns": "^1.30.1", |
v 1.29
import { distanceInWords, parse } from 'date-fns';
->2.27.0
import { formatDistance, parseISO } from "date-fns";
/**
- @desc Checks the difference between the current time and a provided time
*/
export function diffBetweenCurrentTime(timestamp:string) {
return formatDistance(parseISO(timestamp), new Date(), {
addSuffix: true,
includeSeconds: true,
}).replace(/^(about|less than)\s/i, "");
}
Metadata
Metadata
Assignees
Labels
No labels