Skip to content

Question about a more robust date rule syntax for Eid al-Fitr dates for Saudi Arabia #543

@hnw

Description

@hnw

Hi.

Thank you for maintaining this very helpful library.

I'm the author of Pull Request #542, which aims to correct the Eid al-Fitr dates for Saudi Arabia. In that PR, I initially used 30 Ramadan P4D to define a holiday that starts "the day after the 29th of Ramadan." As noted in my PR description, this approach relies on a specific behavior of the underlying caldate library, which could be brittle.

After submitting the PR, I discovered by chance that the syntax 1 day after 29 Ramadan P4D also works as expected. This syntax is far more intuitive and self-documenting. More importantly, it seems to remove the dependency on the internal logic of caldate for handling non-existent dates like the 30th of Ramadan.

However, after reviewing docs/specification.md, I could not find this DD day(s) after <date> grammar pattern documented for Hijri (or other calendar) dates.

Could you please clarify if this is an intentionally supported syntax?

  • If it is supported: I believe it's a fantastic feature. Would you be open to a suggestion to add it to the official specification document? It would be incredibly helpful for defining similar holidays.
  • If it's not an intentional feature: Is there a risk that this behavior might change or break in a future release?

Depending on your feedback, I would be happy to update my pull request to use this cleaner and more robust syntax.

Thank you for your time and guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions