Skip to content

Releases: ursm/date_values

v0.2.2

21 Mar 06:04
cba2055

Choose a tag to compare

  • TimeOfDay#- accepts TimeOfDay to return difference in seconds

v0.2.1

21 Mar 05:14
9b4d279

Choose a tag to compare

  • Add TimeOfDay arithmetic (+, -), advance, change, to_seconds, .from_seconds
  • Add YearMonth#advance, YearMonth#change, YearMonth#days
  • Add MonthDay#change
  • Add #as_json to all value classes
  • Add DateValues.config.month_day_order for locale-dependent MonthDay.parse

v0.2.0

20 Mar 08:45
66e2aa8

Choose a tag to compare

Breaking: Rails integration extracted to date_values-rails.

require 'date_values/rails' now requires installing the date_values-rails gem.

bundle add date_values-rails

v0.1.4

20 Mar 07:26
882f9f1

Choose a tag to compare

  • Cast returns nil for invalid input instead of raising, following Rails convention
  • Add date_value validator to distinguish "invalid input" from "no input"
  • #inspect now uses #<ClassName value> format following Ruby convention
  • Works with Rails standard validators (comparison, inclusion, exclusion)

v0.1.3

19 Mar 15:28
80eeb6d

Choose a tag to compare

  • Fix ActiveRecord type registration — use ActiveSupport.on_load(:active_record) to register types regardless of load order
  • Values now work directly in ActiveRecord queries (Shop.where(billing_month: YearMonth.new(2026, 3)))

v0.1.2

19 Mar 14:44
8b39339

Choose a tag to compare

  • Add #strftime to YearMonth, MonthDay, and TimeOfDay
  • Add I18n backend extension for Rails l helper — looks up year_month.formats, month_day.formats, and time_of_day.formats in locale files

v0.1.1

19 Mar 14:09
c7299c9

Choose a tag to compare

  • Add .from class methods for converting from Date / Time (YearMonth.from(date), MonthDay.from(date), TimeOfDay.from(time))

v0.1.0

19 Mar 13:44
3987d09

Choose a tag to compare

Initial release

  • DateValues::YearMonth — year-month value object with arithmetic (+, -), Range support, and Date conversion
  • DateValues::MonthDay — month-day value object with ISO 8601 --MM-DD format
  • DateValues::TimeOfDay — time-of-day value object with optional seconds
  • All classes are Data.define-based (immutable, value equality) and include Comparable
  • require 'date_values/rails' registers ActiveModel types (:year_month, :month_day, :time_of_day)
  • RBS type signatures included