Module: Mongoid::Criteria::Queryable::Extensions::Date
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Defined in: | lib/mongoid/criteria/queryable/extensions/date.rb |
Overview
Adds query type-casting behavior to Date
class.
Instance Method Summary
-
#__evolve_date__ ⇒ Time
Evolve the date into a mongo friendly time, UTC midnight.
-
#__evolve_time__ ⇒ Time | ActiveSupport::TimeWithZone
Evolve the date into a time, which is always in the local timezone.
Instance Method Details
#__evolve_date__ ⇒ Time
Evolve the date into a mongo friendly time, UTC midnight.
# File 'lib/mongoid/criteria/queryable/extensions/date.rb', line 18
def __evolve_date__ ::Time.utc(year, month, day, 0, 0, 0, 0) end
#__evolve_time__ ⇒ Time | ActiveSupport::TimeWithZone
Evolve the date into a time, which is always in the local timezone.
# File 'lib/mongoid/criteria/queryable/extensions/date.rb', line 28
def __evolve_time__ ::Time.zone.local(year, month, day) end