Skip to content

Keep year if months in year+month+day-range differ

The opening hours specification allows combining years in a <monthday_range> when:

  1. only years and months are specified (via [ <year> ] <month> - <month>), e.g. 2020 Mar-2020 Jun -> 2020 Mar-Jun, OR
  2. the years and months are equal (via <date_from> [ <date_offset> ] - <date_to> [ <date_offset> ], where <date_from> = [ <year> ] <month> <daynum> and <date_to> = <daynum>)

This is all correctly implemented.

However, in case the years are equal, but the months differ, and days are specified (e.g. 2020 Apr 22-2020 Jun 23) this simplification (to 2020 Apr 22-Jun 23) cannot be made: the specification does not state that it should be assumed that the year of the end date is assumed to be the same as the year of the start date if the former isn't specified.

This issue is similar to the issue fixed by this commit: 90607879

This merge request prevents combining the year in such situations, and adds test cases for these situations.

Fixes BUG: 452236

Edited by Fam Lam

Merge request reports