Closed CuteReimu closed 3 years ago
This seems to cause a lot of test failures. Do they need an update to match the bug?
The macro ISO_8601_DATETIME_FORMAT is incorrect. It should be "Y-m-dTH:i:sZ" rather than "Y-m-dTG:i:sZ". So is ISO_8601_DATETIME_WITH_MS_FORMAT. That will fix the test failures.
Can you add a single test that at least shows the desired padding behaviour of G
? Something like this:
so something like this:
?_assertEqual(format("D M j G:i:s Y", {{2001,3,10},{5,16,17}}), "Sat Mar 10 05:16:17 2001"),
?_assertEqual(format("D M j H:i:s Y", {{2001,3,10},{5,16,17}}), "Sat Mar 10 5:16:17 2001"),
on the line below, since we apparently never tested the padding behaviour.
Ok, I'll add some test cases to show the difference between 'H' and 'G'.
In the format parameter string, 'G' should have represented 24-hour format of an hour WITHOUT leading zeros. But it actually results in 24-hour format of an hour WITH leading zeros.