I'm working on a new server-side Swift app. Developing on my Mac, I was able to use DateIntervalFormatter easily, but when I deployed to a Linux server, there were a few issues. First, and less important, the Style enum has mismatched values:
On the Mac, these are .none, .short, etc.
More importantly, of course, is that the class itself isn't implemented. I looked into writing it myself, hoping to be able to forward to DateFormatter for most of the locale complexity, but DateIntervalFormatter seems to be a bit more complicated than that. I think implementing it myself is a bit above my head, but I wanted to start a thread for discussion and somewhat formally ask for an implementation of this class. If I'm reading the status page right, this is one of the last pieces we need for full implementations of all the date/time parts of Foundation.
@spevans I'll comment more in the actual PR, but the design of DateIntervalFormatter on Darwin takes a bit of a different direction than what you've got in the PR.
On Darwin, we use the properties set on the DateIntervalFormatter to configure a DateFormatter to generate a format string template, then configure the UDateIntervalFormat with that format string template. If the user sets an explicit date template on the formatter, we use that.
On mutation of any of the mutable properties, we regenerate a format template, hence why the property is mutable. It doesn't have anything to do with Locale.calendar, though — Locale.calendar is defined exclusively by the locale identifier and shouldn't factor into this except as a fallback in case the calendar is not set. (That is also why Locale.calendar is read-only)