Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5425

Verify string mongoization into Date, Time, DateTime with time zones

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.1
    • 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.

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: