-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from xx45/dev
feat(api): add year(), month()
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import moment from 'moment' | ||
import dayjs from '../src' | ||
|
||
test('Year', () => { | ||
expect(dayjs().year()).toBe(moment().year()) | ||
}) | ||
|
||
test('Month', () => { | ||
expect(dayjs().month()).toBe(moment().month()) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import moment from 'moment' | ||
import dayjs from '../src' | ||
|
||
test('StartOf Year', () => { | ||
expect(dayjs().startOf('year').unix()).toBe(moment().startOf('year').unix()) | ||
}) | ||
|
||
test('StartOf Month', () => { | ||
expect(dayjs().startOf('month').unix()).toBe(moment().startOf('month').unix()) | ||
}) | ||
|
||
test('StartOf Other', () => { | ||
expect(dayjs().startOf('otherString').unix()).toBe(moment().startOf('otherString').unix()) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters