-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
The logic for conversion of various objects that act like time (Time, AS::TimeWithZone, DateTime) to Date objects returned from Date fields is described in https://www.mongodb.com/docs/mongoid/master/reference/fields/#field-type-date.
mongoize should behave in the same manner when given string input for Date fields.
Test cases to check:
Date only: "2020-02-02"
Date with time: "2020-02-02 03:03:03"
Date with time and zone: "2020-02-02 03:03:03 +1000"
These cases should be tested with the following 3 possible environment settings as per https://www.mongodb.com/docs/mongoid/master/reference/configuration/#time-zones:
use_utc=true
use_utc=false, use_activesupport_time_zone=true
use_utc=false, use_activesupport_time_zone=false
This should also be done for Time and DateTime fields.
- has to be done after
-
MONGOID-5222 Always mongoize uncastable values to nil
- Closed
-
MONGOID-5221 Always demongoize uncastable values to nil
- Closed