osmlint icon indicating copy to clipboard operation
osmlint copied to clipboard

Timespan linter - missed leading zero in hour time range 01-09

Open Andygol opened this issue 7 years ago • 0 comments

open_hours specification highlighted time that we use 24hr time format for specifying time range(s), date format which is two letters, three letters month code first letters of this day and month should be in Uppercase.

https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#hour

Valid value is 2-digit hours notation – 00 | 01 | …| 09 | 10 | … | 16| … | 23 | 24

Missed leading 0️⃣ digit is a common issue for time range 0️⃣1️⃣- 0️⃣9️⃣ hours. You may find such values as 7:00 for 7am instead of 07:00.

It is good to have a linter which checks open_hours values in all possible uses (for example in conditional restrictions).

The library which we can use for this sanity checks - https://github.com/opening-hours/opening_hours.js

image

Things to check in linter

  • [ ] invalid day format
  • [ ] Invalid time format for both hours and minuts
  • [ ] Invalid month format

/cc @maning @srividyacb @rub21

Andygol avatar Mar 09 '18 06:03 Andygol