opening-hours-syntax

Crates.ioopening-hours-syntax
lib.rsopening-hours-syntax
version0.6.18
sourcesrc
created_at2021-02-22 15:55:21.031254
updated_at2023-11-27 15:26:59.733271
descriptionA parser for opening_hours fields in OpenStreetMap.
homepagehttps://github.com/remi-dupre/opening-hours-rs/tree/master/opening-hours-syntax
repositoryhttps://github.com/remi-dupre/opening-hours-rs
max_upload_size
id359050
size59,291
Rémi Dupré (remi-dupre)

documentation

https://docs.rs/opening-hours-syntax

README

Rust parser for OSM Opening Hours

Parsing component of opening-hours crate.

Usage

Add this to your Cargo.toml:

[dependencies]
opening-hours-syntax = "0"

And then a basic usage would look like that:

use opening_hours_syntax::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";

fn main() {
    let oh = parse(&OH).unwrap();
    eprintln!("{:?}", oh);
}
Commit count: 167

cargo fmt