@voiceflow/common
Advanced tools
Comparing version 7.5.0 to 7.6.0
@@ -13,2 +13,3 @@ "use strict"; | ||
const relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime")); | ||
const updateLocale_1 = __importDefault(require("dayjs/plugin/updateLocale")); | ||
const utc_1 = __importDefault(require("dayjs/plugin/utc")); | ||
@@ -21,2 +22,21 @@ dayjs_1.default.extend(utc_1.default); | ||
dayjs_1.default.extend(advancedFormat_1.default); | ||
dayjs_1.default.extend(updateLocale_1.default); | ||
// https://day.js.org/docs/en/customization/relative-time | ||
dayjs_1.default.updateLocale('en', { | ||
relativeTime: { | ||
future: 'in %s', | ||
past: '%s ago', | ||
s: 'seconds', | ||
m: 'a minute', | ||
mm: '%d minutes', | ||
h: 'an hour', | ||
hh: '%d hours', | ||
d: 'a day', | ||
dd: '%d days', | ||
M: 'a month', | ||
MM: '%d months', | ||
y: 'a year', | ||
yy: '%d years', | ||
}, | ||
}); | ||
const getCurrentTimestamp = () => Math.floor(Date.now() / 1000); | ||
@@ -23,0 +43,0 @@ exports.getCurrentTimestamp = getCurrentTimestamp; |
{ | ||
"name": "@voiceflow/common", | ||
"description": "Junk drawer of utility functions", | ||
"version": "7.5.0", | ||
"version": "7.6.0", | ||
"author": "Voiceflow", | ||
@@ -6,0 +6,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170230
3162