Module: DatePatch
- Defined in:
- lib/dynamic_time_zone/date_patch.rb
Instance Method Summary collapse
Instance Method Details
#current ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/dynamic_time_zone/date_patch.rb', line 4 def current # Normally, Date.current ends up calling Time.zone.now which ends up passing the # dynamic zone offset to Time which can raises out of range error. Here, we attempt # to avoid that by grabbing the date out of time (which already works correctly with # dynaminc time zones). Time.current.to_date end |