Skip to content

Commit

Permalink
fix: fix ios safari YYYY-MM-DD HH:mm parse BUG
Browse files Browse the repository at this point in the history
fix #254
  • Loading branch information
iamkun committed Feb 4, 2019
1 parent 457c435 commit e02ae82
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ describe('Core APIs', function () {
.format('{YYYY} MM-DDTHH:mm:ss')).toBe('{2010} 04-25T00:00:00')
})

it('Date parse - nonstandard date string with only one digit', function () {
expect(dayjs('2018-4-1 1:1:1:22').isValid())
.toBe(true)
expect(dayjs('2018-4-1').isValid())
.toBe(true)
it('Date parse - nonstandard date string', function () {
expect(dayjs('2018-4-1 1:1:1:22').format('YYYY-MM-DD hh:mm:ss'))
.toBe('2018-04-01 01:01:01')
expect(dayjs('2018-4-1').format('YYYY-MM-DD hh:mm:ss'))
.toBe('2018-04-01 12:00:00')
expect(dayjs('2018-4-1 11:49').format('YYYY-MM-DD hh:mm:ss')) // fix ios bug
.toBe('2018-04-01 11:49:00')
})
})

0 comments on commit e02ae82

Please sign in to comment.