JavaScript in the morning, JavaScript in the evening…
I’ve been a huge fan of the Intl spec for sometime, having done multiple presentations and blog posts on the topic. Every time I think I’ve explored it completely, I come across another interesting gem. Today I’m going to share one that is possibly not something you would use, but it’s a curious feature of the spec I wanted to dig more into.
When formatting dates with Intl.DateTimeFormat, you’ve got a large set of customizations you can use to display dates exactly as you want. I recently came across an interesting part of the formatting options, dayPeriod.
According to MDN, this specifies:
The formatting style used for day periods like “in the morning”,... more →
Posted in: JavaScript