Changes
PLEASE READ
I've made some changes around timezone conversion to make the API more explicit, and open up some options previously unavailable for working with DateTime objects. Make note of the changes below and how they may affect you, if at all.
- Timezone.convert now does the time shift AND sets the timezone. Previously it only shifted the time.
Date.set(date, timezone: tz)
no longer does implicit timezone conversion. You must use Timezone.convert if you want to shift a date to another timezone.- Added Date.compare/3, which takes a granularity option for determining equality during a comparison. The options available are :years, :months, :weeks, :days, :hours, :mins, :secs, and :timestamp - in other words, the same options that Date.diff takes. This means that if you have two dates only off by a few hours,
Date.compare(a, b, :days)
will return 0, or equal.
Please let me know if you run into any issues with this release. Thanks!