module Mongoid::Extensions::Date
Constants
- EPOCH
Constant for epoch - used when passing invalid times.
@deprecated No longer used as a return value from mongoize passed
an invalid date string.
Public Instance Methods
__mongoize_time__()
click to toggle source
Convert the date into a time.
@example Convert the date to a time.
Date.new(2018, 11, 1).__mongoize_time__ # => Thu, 01 Nov 2018 00:00:00 EDT -04:00
@return [ Time | ActiveSupport::TimeWithZone ] Local time in the
configured default time zone corresponding to local midnight of this date.
@since 3.0.0
# File lib/mongoid/extensions/date.rb, line 23 def __mongoize_time__ ::Time.configured.local(year, month, day) end