Rust implementation for OSM Opening Hours
TODO: add link to Python library's README
A Rust library for parsing and working with OSM's opening hours field. You can find its specification here and the reference JS library here.
Note that the specification is quite messy and that the JS library takes liberty to extend it quite a lot. This means that most of the real world data don't actually comply to the very restrictive grammar detailed in the official specification. This library tries to fit with the real world data while remaining as close as possible to the core specification.
Usage
Add this to your Cargo.toml:
[]
= "0"
Here's a simple example that parse an opening hours description and displays its current status and date for next change:
use Local;
use parse;
// Opens until 18pm during the week and until 12am the week-end.
const OH: &str = "Mo-Fr 10:00-18:00; Sa-Su 10:00-12:00";