Introduction | opening-hours-rust | Spatie       

 SPATIE  

  Opening Hours Rust 
=====================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Opening-hours-rust](https://spatie.be/docs/opening-hours-rust/v1)  Introduction

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/opening-hours-rust/v1) 

  Introduction    
- [ Introduction ](https://spatie.be/docs/opening-hours-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/opening-hours-rust/v1/support-us)
- [ Installation ](https://spatie.be/docs/opening-hours-rust/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/opening-hours-rust/v1/usage)
- [ Testing ](https://spatie.be/docs/opening-hours-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/opening-hours-rust/v1/changelog)

 Opening Hours Rust 
====================

 [    Repository ](https://github.com/spatie/opening-hours-rust) 

 [    Open Issues ](https://github.com/spatie/opening-hours-rust/issues) 

    0 

    0 

Introduction
------------

With `spatie-opening-hours` you create an object that describes a business' opening hours, which you can query for open or closed on days or specific dates, or use to present the times per day.

A set of opening hours is created by passing in a regular schedule, and a list of exceptions.

```
use spatie_opening_hours::{OpeningHours, serde_json::json};

let opening_hours = OpeningHours::create(json!({
    "monday": ["09:00-12:00", "13:00-18:00"],
    "exceptions": { "2016-12-25": [], "01-01": [] }
}))?;

assert!(opening_hours.is_open_on("monday")?);
assert!(opening_hours.is_closed_on("2016-12-25")?);
```

Continue with [installation](installation-and-setup) and [usage](usage).

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
