UNPKG

dayjs

Version:

2KB immutable date time library alternative to Moment.js with the same modern API

12 lines 453 B
export default (function (option, Dayjs, dayjs) { dayjs.updateLocale = function (locale, customConfig) { var localeList = dayjs.Ls; var localeConfig = localeList[locale]; if (!localeConfig) return; var customConfigKeys = customConfig ? Object.keys(customConfig) : []; customConfigKeys.forEach(function (c) { localeConfig[c] = customConfig[c]; }); return localeConfig; // eslint-disable-line consistent-return }; });