Files
JiboViteDocs/node_modules/timeago.js/esm/format.js

15 lines
418 B
JavaScript
Raw Normal View History

2026-05-03 12:12:57 -04:00
import { formatDiff, diffSec } from './utils/date';
import { getLocale } from './register';
/**
* format a TDate into string
* @param date
* @param locale
* @param opts
*/
export var format = function (date, locale, opts) {
// diff seconds
var sec = diffSec(date, opts && opts.relativeDate);
// format it with locale
return formatDiff(sec, getLocale(locale));
};
//# sourceMappingURL=format.js.map