Skip to content

Commit

Permalink
fix: Set + Get accept 'D' as the short version of 'date' (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun committed Feb 14, 2020
1 parent 894c86c commit 523c038
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const prettyUnit = (u) => {
y: C.Y,
w: C.W,
d: C.D,
D: C.DATE,
h: C.H,
m: C.MIN,
s: C.S,
Expand Down
10 changes: 9 additions & 1 deletion test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ it('PrettyUnit', () => {
expect(prettyUnit('Days')).toBe('day')
expect(prettyUnit('days')).toBe('day')
expect(prettyUnit('day')).toBe('day')
expect(prettyUnit('Q')).toBe('quarter')
expect(prettyUnit('quarter')).toBe('quarter')
expect(prettyUnit('quarters')).toBe('quarter')
expect(prettyUnit('D')).toBe('date')
expect(prettyUnit('d')).toBe('day')
expect(prettyUnit('M')).toBe('month')
expect(prettyUnit('y')).toBe('year')
expect(prettyUnit('h')).toBe('hour')
expect(prettyUnit('m')).toBe('minute')
expect(prettyUnit('s')).toBe('second')
expect(prettyUnit('ms')).toBe('millisecond')
expect(prettyUnit('Q')).toBe('quarter')
expect(prettyUnit()).toBe('')
})

Expand Down

0 comments on commit 523c038

Please sign in to comment.