-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update date utils to parse year correctly for years 1-999 (#9236)
* fix: update date utils to parse year correctly for years 1-999 Closes: #9230 * fix: commit change to date utils * fix: default total length to 2
- Loading branch information
Showing
2 changed files
with
19 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { DateUtils } from "../../../src/util/DateUtils" | ||
import { expect } from "chai" | ||
|
||
describe("github issues > #9230 Incorrect date parsing for year 1-999", () => { | ||
describe("mixedDateToDateString", () => { | ||
it("should format a year less than 1000 with correct 0 padding", () => { | ||
expect( | ||
DateUtils.mixedDateToDateString(new Date("0202-01-01")), | ||
).to.eq("0202-01-01") | ||
}) | ||
}) | ||
}) |