Crates.io | opening-hours-syntax |
lib.rs | opening-hours-syntax |
version | 0.8.2 |
source | src |
created_at | 2021-02-22 15:55:21.031254 |
updated_at | 2024-10-30 22:13:53.45415 |
description | A parser for opening_hours fields in OpenStreetMap. |
homepage | https://github.com/remi-dupre/opening-hours-rs/tree/master/opening-hours-syntax |
repository | https://github.com/remi-dupre/opening-hours-rs |
max_upload_size | |
id | 359050 |
size | 70,851 |
Parsing component of opening-hours crate.
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);
}