Skip to content

Commit 327407b

Browse files
committed
test(date-utils): add failing test case for parseDate
1 parent 50488b4 commit 327407b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/date_utils_test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,16 @@ describe("date_utils", function () {
818818
expect(parseDate(value, dateFormat, null, true)).to.not.be.null;
819819
});
820820

821+
it("should parse date based on locale", () => {
822+
const value = "26/05/1995";
823+
const dateFormat = "P";
824+
825+
const expected = new Date("05/26/1995");
826+
const actual = parseDate(value, dateFormat, "pt-BR", true);
827+
828+
assert(isEqual(actual, expected));
829+
});
830+
821831
it("should parse date that matches one of the formats", () => {
822832
const value = "01/15/2019";
823833
const dateFormat = ["MM/dd/yyyy", "yyyy-MM-dd"];
@@ -846,7 +856,7 @@ describe("date_utils", function () {
846856
expect(parseDate(value, dateFormat, null, false)).to.not.be.null;
847857
});
848858

849-
it("should parse date based on locale", () => {
859+
it("should parse date based on locale without strict parsing", () => {
850860
const value = "26/05/1995";
851861
const dateFormat = "P";
852862

0 commit comments

Comments
 (0)