simonpoole / OpeningHoursParser

Parser for string values according to the OSM opening hours specification
MIT License
32 stars 12 forks source link

Canonical form: Jumbled order of nth weekdays #79

Closed westnordost closed 10 months ago

westnordost commented 10 months ago

This parser outputs a canonical form of the parsed opening hours string for better readability. However, there seems to be a bug for nth weekdays.

E.g. "all Sundays except the 2nd Sunday of each month": Su[1,3,4,5] is changed to Su[1,5,4,3].

This does not increase readability, actually, why change the order at all?

simonpoole commented 10 months ago

Without actually checking, I'm fairly sure that is an artifact of how the numbers are collected during parsing and it is just missing a Collections.reverse at some point.