Skip to content

Commit

Permalink
fixed formatting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
waseemahmad31 committed Mar 17, 2019
1 parent eeb20fa commit 9b3ba88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin/customParseFormat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const matchUpperCaseAMPM = /[AP]M/
const matchLowerCaseAMPM = /[ap]m/
const matchSigned = /[+-]?\d+/ // -inf - inf
const matchOffset = /[+-]\d\d:?\d\d/ // +00:00 -00:00 +0000 or -0000
const matchWord = /\d*[^\s\d]+/ // Word
const matchWord = /\d*[^\s\d-:/.()]+/ // Word

let locale

Expand Down
6 changes: 6 additions & 0 deletions test/plugin/customParseFormat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ it('parse padded string', () => {
expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf())
})

it('parse string for MMM month format', () => {
const input = '4/Mar/2019:11:16:26 +0800'
const format = 'D/MMM/YYYY:H:m:s zz'
expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf())
})

it('parse string January (getMonth() = 0)', () => {
const input = '01/01/2019'
const format = 'DD/MM/YYYY'
Expand Down

0 comments on commit 9b3ba88

Please sign in to comment.