orbitjs / orbit

Composable data framework for ambitious web applications.
https://orbitjs.com
MIT License
2.33k stars 134 forks source link

Make date serializer respect ISO 8601 #940

Closed ef4 closed 2 years ago

ef4 commented 2 years ago

The default date serializer looks like it intends to follow ISO 8601, and its test says "#serialize returns a date in YYYY-MM-DD form".

But it doesn't always emit YYYY-MM-DD form, because it doesn't insert leading zeros for single digit months and days. This results in dates that aren't strictly conformant to ISO 8601.

This change adds the necessary padding.

dgeb commented 2 years ago

Thanks @ef4. I'm going to mark this as a bugfix and ship in the next patch release.