-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename standalone formatDateTime to formatSortableDateTime
- Loading branch information
Showing
5 changed files
with
44 additions
and
32 deletions.
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
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import { formatDateTime } from '../time'; | ||
import { formatSortableDateTime } from '../time'; | ||
|
||
describe('sidebar/util/time', () => { | ||
describe('formatDateTime', () => { | ||
[ | ||
new Date(Date.UTC(2023, 11, 20, 3, 5, 38)), | ||
new Date('2020-05-04T23:02:01+05:00'), | ||
].forEach(date => { | ||
it('returns right format for provided date', () => { | ||
const expectedDateRegex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/; | ||
assert.match(formatDateTime(date), expectedDateRegex); | ||
}); | ||
describe('formatSortableDateTime', () => { | ||
[ | ||
new Date(Date.UTC(2023, 11, 20, 3, 5, 38)), | ||
new Date('2020-05-04T23:02:01+05:00'), | ||
].forEach(date => { | ||
it('returns right format for provided date', () => { | ||
const expectedDateRegex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/; | ||
assert.match(formatSortableDateTime(date), expectedDateRegex); | ||
}); | ||
}); | ||
}); |
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