Skip to content

Commit

Permalink
add easter support
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-dupre committed Feb 2, 2025
1 parent 819aa8f commit fb205f1
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 32 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 1.0.0

That's not really a huge milestone, but:

- Every "obviously missing things" that I had in mind are implemented now.
- The API proved itself to be quite stable.

### General

- Add easter support

## 0.11.1

### Rust
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opening-hours"
version = "0.11.1"
version = "1.0.0"
authors = ["Rémi Dupré <remi@dupre.io>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down Expand Up @@ -34,9 +34,9 @@ log = ["opening-hours-syntax/log", "dep:log"]

[dependencies]
chrono = "0.4"
compact-calendar = { path = "compact-calendar", version = "0.11.1" }
compact-calendar = { path = "compact-calendar", version = "1.0.0" }
flate2 = "1.0"
opening-hours-syntax = { path = "opening-hours-syntax", version = "0.11.1" }
opening-hours-syntax = { path = "opening-hours-syntax", version = "1.0.0" }
sunrise-next = "1.2"

# Feature: log (default)
Expand All @@ -51,7 +51,7 @@ tzf-rs = { version = "0.4", default-features = false, optional = true }

[build-dependencies]
chrono = "0.4"
compact-calendar = { path = "compact-calendar", version = "0.11.1" }
compact-calendar = { path = "compact-calendar", version = "1.0.0" }
country-boundaries = { version = "1.2", optional = true }
flate2 = "1.0"
rustc_version = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion compact-calendar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "compact-calendar"
version = "0.11.1"
version = "1.0.0"
authors = ["Rémi Dupré <remi@dupre.io>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
6 changes: 3 additions & 3 deletions opening-hours-py/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opening-hours-py"
version = "0.11.1"
version = "1.0.0"
authors = ["Rémi Dupré <remi@dupre.io>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -21,12 +21,12 @@ pyo3-log = "0.12"

[dependencies.opening-hours]
path = ".."
version = "0.11.1"
version = "1.0.0"
features = ["log", "auto-country", "auto-timezone"]

[dependencies.opening-hours-syntax]
path = "../opening-hours-syntax"
version = "0.11.1"
version = "1.0.0"
features = ["log"]

[dependencies.pyo3]
Expand Down
2 changes: 1 addition & 1 deletion opening-hours-syntax/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opening-hours-syntax"
version = "0.11.1"
version = "1.0.0"
authors = ["Rémi Dupré <remi@dupre.io>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
24 changes: 6 additions & 18 deletions opening-hours/src/filter/date_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,12 @@ impl DateFilter for ds::MonthdayRange {

fn on_year(date: ds::Date, for_year: i32) -> Option<NaiveDate> {
match date {
ds::Date::Fixed { year, month, day } => {
if year.is_some() && i32::from(year.unwrap()) != for_year {
return None;
}

Some(first_valid_ymd(
year.map(Into::into).unwrap_or(for_year),
month.into(),
day.into(),
))
}
ds::Date::Easter { year } => {
if year.is_some() && i32::from(year.unwrap()) != for_year {
return None;
}

easter(year.map(Into::into).unwrap_or(for_year))
}
ds::Date::Easter { year } => easter(year.map(Into::into).unwrap_or(for_year)),
ds::Date::Fixed { year, month, day } => Some(first_valid_ymd(
year.map(Into::into).unwrap_or(for_year),
month.into(),
day.into(),
)),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "opening-hours-py"
version = "0.11.1"
version = "1.0.0"
description = "A parser for the opening_hours fields from OpenStreetMap."
authors = ["Rémi Dupré <remi@dupre.io>"]
package-mode = false
Expand Down

0 comments on commit fb205f1

Please sign in to comment.