1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #18967 from calixteman/bug1910431

Make util.scand a bit more flexible with dates which don't match the given format (bug 1910431)
This commit is contained in:
calixteman 2024-10-28 09:36:34 +01:00 committed by GitHub
commit 2bee3af0ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 108 additions and 110 deletions

View file

@ -243,6 +243,12 @@ describe("Scripting", function () {
value = await myeval(`util.scand(2, "4/15/07 3:14:15 am").toString()`);
expect(new Date(value)).toEqual(date);
value = await myeval(`util.scand("mmddyyyy", "07/15/2007").toString()`);
expect(new Date(value)).toEqual(new Date("07/15/2007"));
value = await myeval(`util.scand("mmddyyyy", "07a15b2007").toString()`);
expect(new Date(value)).toEqual(new Date("07/15/2007"));
});
});