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, "");
}
pattern/client/package.json
Line 10 in 15bce03
v 1.29
import { distanceInWords, parse } from 'date-fns';
->2.27.0
import { formatDistance, parseISO } from "date-fns";
/**
*/
export function diffBetweenCurrentTime(timestamp:string) {
return formatDistance(parseISO(timestamp), new Date(), {
addSuffix: true,
includeSeconds: true,
}).replace(/^(about|less than)\s/i, "");
}