Replies: 1 comment 6 replies
-
Yes it is indeed being left out intentionally! This decision comes straight from Temporal. I'm short on time at the moment, so I can't find a precise Temporal reference for you (I'll follow-up probably tomorrow) explaining things, but here's my understanding:
Note: In non-Gregorian calendars, weeks aren't always 7 days. But this on its own isn't necessarily disqualifying since it just makes it non-uniform, and spans already support other types of non-uniform units. Fun fact: ISO 8601-1 actually doesn't allow week units to appear with other units. They are only allowed as part of an extension in ISO 8601-2. I'll dig through the Temporal materials and see if I can fine a more concrete answer. I'm about 95% confident in my above answer though.
Please let me know if there's anything I can do to help! Feel free to DM me on Discord or Zulip. I'm burntsushi or burntsushi5 everywhere. |
Beta Was this translation helpful? Give feedback.
-
First of all, thank you for creating this crate and taking input from twitter/x with how people would like to see a new datetime crate. ❤️
I'm exploring jiff in the hopes that it can replace chrono in nushell. I'm working on a nushell plugin to do this. If we set aside the lackluster implementation details of my dt plugin, I get a span printed like the example below for trying to find the verbose difference between two datetimes.
What I'm curious about is why it says
5y2m27d
instead of5y2m3wk6d
? i.e. there is no week component even though there are 27 days. Knowing your work, I can only assume that week is being left out intentionally and left up to me to translate from days to weeks.Beta Was this translation helpful? Give feedback.
All reactions