Skip to content

Static parse methods and new >> operator

Latest
Compare
Choose a tag to compare
@bdkosher bdkosher released this 15 Jul 16:47
· 1 commit to master since this release

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.