Sha256: cf2d393b3bc3af6a001599956418a004801fe62cbb6dd2ef9e6210fe62cf6f64
Contents?: true
Size: 352 Bytes
Versions: 11
Compression:
Stored size: 352 Bytes
Contents
require 'date' require 'active_support/core_ext/time/zones' class Date # Converts Date to a TimeWithZone in the current zone if Time.zone_default is set, # otherwise converts Date to a Time via Date#to_time def to_time_in_current_zone if ::Time.zone_default ::Time.zone.local(year, month, day) else to_time end end end
Version data entries
11 entries across 11 versions & 2 rubygems