Closed ptomato closed 5 months ago
This is a known issue. https://issues.chromium.org/issues/40893567
I'm not convinced this is conformant, given that both APIs call into PartitionDateTimePattern. At least, without evidence to the contrary, I would expect that PartitionDateTimePattern returns the same value for the same inputs
That's a very good point, I'm convinced. Closing.
Yeah, the spec requires format and formatToParts to be the same. Browsers that don't currently do this are not conformant with that part of the spec.
This test uses formatToParts() to find out what kind of whitespace is used before the dayPeriod component, and expect that whitespace consistently.
I've observed an inconsistency between format() and formatToParts() on Node 20.7.0, so this method isn't reliable. An example:
This is conformant with the spec.
So, change the test to just allow any kind of whitespace. It'd be better to rewrite the test to rely less on particular output, but I'm not prepared to do that right now.