Skip to content

Releases: bdkosher/goodtimes

Static parse methods and new >> operator

15 Jul 16:47
Compare
Choose a tag to compare

Breaking Changes

  • Replaced the binary - operator with >> for generating a Period or Duration from two instances of the same java.time type. The Java 8 Date/Time API defines a minus(TemporalAmount a) method on these types that was causing conflicts with the Goodtimes version of minus.

API Enhancements

  • Added static parse(CharSequence input, String format) methods on the parseable java.time types
  • Added toOffsetTime() method to java.util.Date and java.util.Calendar
  • Added getZoneId() and getZoneOffset() properties to java.util.Date
  • Added toZoneOffset() methods to java.util.TimeZone
  • Added isWeekend() and isWeekday() properties to DayOfWeek
  • Added leftShift(Year year) method to Month to complement the leftShift(Month month) method on Year
  • Added asType() method to Month and DayOfWeek for coersion into numeric types according to their getValue(), as also supported by Year
  • Overloaded the toZonedDateTime() method on java.util.Date and java.util.Calendar to accept an optional ZoneId or TimeZone argument

Bug fixes

  • Milliseconds incorrect when generating java.time types with a time element (e.g. LocalTime) from java.util.Date or java.util.Calendar
  • Afternoon hours incorrect when generating java.time types with a time element (e.g. LocalTime) from java.util.Date or java.util.Calendar
  • The toDate() method of OffsetTime not converting time values according to the system default offset.

Zone and Offset-Aware

18 Jun 22:22
Compare
Choose a tag to compare
  • New methods for the zone/offset-aware types: OffsetTime, OffsetDateTime, ZoneId, ZoneOffset, ZonedDateTime
  • Switched Groovy dependency to compileOnly to avoid downloading a superfluous copy of groovy-all when not using Groovy 2.4.8
  • getMonthDay() added to java.util.Calendar
  • getDay() added to java.time.MonthDay
  • toCalendar() methods support a single Locale argument
  • The minus() method on java.time.Year yields a Period now; the plus() method on that type has been removed (breaking change)
  • toDate() methods no longer accept Locale or TimeZone arguments because it doesn't make sense nor work property (breaking change)