1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-31 15:16:18 +00:00

Fix UTC format date string test properly this time (#6709)

Hours could also end up as a single-digit number, just like date, if
timezone offset is low enough that it wraps around midnight.
This commit is contained in:
Robin Munn 2022-05-24 16:02:45 +07:00 committed by GitHub
parent 2a62da1498
commit a226975b3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,8 @@ describe("Utility tests", function() {
const day = d.getUTCDate();
const dayStr = ("" + day).padStart(2, '0');
const hours = d.getUTCHours();
const expectedUtcStr = `201411${dayStr}${hours}4128542`;
const hoursStr = ("" + hours).padStart(2, '0');
const expectedUtcStr = `201411${dayStr}${hoursStr}4128542`;
expect(fds(d,"[UTC]YYYY0MM0DD0hh0mm0ssXXX")).toBe(expectedUtcStr);
// test some edge cases found at: https://en.wikipedia.org/wiki/ISO_week_date