index.js 603 B

1234567891011121314151617181920
  1. import { FORMAT_DEFAULT } from '../../constant';
  2. import { u, englishFormats } from './utils';
  3. export default (function (o, c, d) {
  4. var proto = c.prototype;
  5. var oldFormat = proto.format;
  6. d.en.formats = englishFormats;
  7. proto.format = function (formatStr) {
  8. if (formatStr === void 0) {
  9. formatStr = FORMAT_DEFAULT;
  10. }
  11. var _this$$locale = this.$locale(),
  12. _this$$locale$formats = _this$$locale.formats,
  13. formats = _this$$locale$formats === void 0 ? {} : _this$$locale$formats;
  14. var result = u(formatStr, formats);
  15. return oldFormat.call(this, result);
  16. };
  17. });