Skip to content

Commit

Permalink
fix: fix localizedFormat export error (#1133)
Browse files Browse the repository at this point in the history
fix #1132
  • Loading branch information
iamkun authored Oct 13, 2020
1 parent f2f6956 commit deecd6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/plugin/localeData/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { t } from '../localizedFormat'
import { t } from '../localizedFormat/utils'

export default (o, c, dayjs) => { // locale needed later
const proto = c.prototype
Expand Down
4 changes: 1 addition & 3 deletions src/plugin/localizedFormat/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { FORMAT_DEFAULT } from '../../constant'

export const t = format =>
format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1))
import { t } from './utils'

export default (o, c, d) => {
const proto = c.prototype
Expand Down
4 changes: 4 additions & 0 deletions src/plugin/localizedFormat/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable-next-line import/prefer-default-export
export const t = format =>
format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1))

0 comments on commit deecd6a

Please sign in to comment.