whenever icon indicating copy to clipboard operation
whenever copied to clipboard

Improving the `[Date|Time|DateTime]Delta` API

Open ariebovenberg opened this issue 2 months ago • 1 comments

There are two design questions for DateDelta:

  • Currently, DateDelta stores years, months, weeks, and days separately. However, in the Gregorian calandar, years are always 12 months, and weeks are always 7 days. It's save on storage to just store months and days. The downside is that users may want to deliberately store unnormalized deltas, such that "24 months" isn't the same as "2 years".
  • On a related note, the DateDelta components may have different signs (P4Y-3M+1W0D). While this is certainly flexible, it's unclear whether this functionality is actually used. Having one single sign would simplify things—although it may result in exceptions when doing arithmetic (whether years(a) + months(b) - years(c) would raise an exception depending on whether the result would have mixed signs).

ariebovenberg avatar Apr 19 '24 10:04 ariebovenberg