Extended json package does not decode canonical dates when relaxed is true

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: EJSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I'd expect the following code:

      EJSON.parse('{"grant_date":{"$date":{"$numberLong":"1452124800000"}}}', {"relaxed": true}) 

      To give me:

      { grant_date: 2016-01-07T00:00:00.000Z }
      

      But I get the current time:

      { grant_date: 2018-04-30T17:10:14.832Z }
      

      The Stitch JS SDK like to give users types back in a relaxed format after parse which normally works with the above for most types but it's not working for $date since a $numberLong becomes a "number" and the $date decoder cannot parse that.

            Assignee:
            Daniel Aprahamian (Inactive)
            Reporter:
            Eric Daniels
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: