Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40383

dateFromParts does not overflow correctly if isoWeek smaller than 1

    • Minor Change
    • ALL
    • v4.2, v4.0, v3.6
    • Query 2019-05-06, Query 2019-05-20, Query 2019-06-03, Query 2019-06-17, Query 2019-07-01, Query 2019-07-15
    • 31

      When using dateFromParts with ISO8601 weeks, the date does not calculate correctly if the isoWeek parameter is less than 1.

      Some examples:

       'date'*:* { $dateFromParts: { isoWeekYear: 2019, isoWeek: 0 } } gives ** 2019-12-24
      
       'date'*:* { $dateFromParts: { isoWeekYear: 2019, isoWeek: -1 } } gives ** 2019-12-17
      
       'date'*:* { $dateFromParts: { isoWeekYear: 2019, isoWeek: -51 } } gives ** 2019-01-01
      
       'date'*:* { $dateFromParts: { isoWeekYear: 2019, isoWeek: -52 } } gives ** 2018-12-25
      

        1. SERVER-40383-master.patch
          21 kB
          Justin Seyster
        2. SERVER-40383-v4.0.patch
          21 kB
          Justin Seyster

            Assignee:
            justin.seyster@mongodb.com Justin Seyster
            Reporter:
            sam@mrmtech.co.za Sam Tolmay
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: