index.js 453 B

123456789101112
  1. export default (function (option, Dayjs, dayjs) {
  2. dayjs.updateLocale = function (locale, customConfig) {
  3. var localeList = dayjs.Ls;
  4. var localeConfig = localeList[locale];
  5. if (!localeConfig) return;
  6. var customConfigKeys = customConfig ? Object.keys(customConfig) : [];
  7. customConfigKeys.forEach(function (c) {
  8. localeConfig[c] = customConfig[c];
  9. });
  10. return localeConfig; // eslint-disable-line consistent-return
  11. };
  12. });