date-format icon indicating copy to clipboard operation
date-format copied to clipboard

Relative times with languages support

Open ohanhi opened this issue 6 years ago • 0 comments

This is a bit of a daring PR out of the blue, so feel free to disagree with my decisions and/or point out issues I might not have noticed. I introduced a new module: DateFormat.Relative.Language. Then I moved the RelativeTimeOptions along with the default (now called english) to that module. Finally, I localized the relative time options for Finnish.

Because of the type moved from DateFormat.Relative to DateFormat.Relative.Language (to avoid circular imports), this change would be a major version. If you'd really like to avoid that, there's at least two ways to do it:

  1. expose the type through a dummy type alias MyType = Module.MyType, which can be confusing for people (which one do they need to import to be able to construct a record?)
  2. move the type back to the old place and keep an unexposed duplicate of the type in DateFormat.Relative.Language for type signature purposes

Note: This builds on #19, the first two commits are in common with it. 6181ece is where the actual changes happen.

ohanhi avatar Jan 09 '19 10:01 ohanhi