Support Easter dates and offsets in opening hours

Open
#2,198 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

The issue says opening hours are parsed separately in the Android app, iOS app, and web server, but does not name their files or tests. Start by locating each parser and its existing opening hours tests, then compare how they handle variable dates, offsets, and status. Done means all three implementations agree on the real tags listed, display Easter dates correctly in every language, and report the expected open or closed status; the Western versus Orthodox Easter choice still needs a decision.

Written by the indexing model from the issue text.

Description

Nice to have

Related

Found while working on #25225, which translates PH, SH and Easter in opening hours. That issue covers only the names; Easter offsets and Easter in the status are this task.

Current behaviour

Opening hours that refer to days around Easter are read wrongly. The POI card shows a wrong schedule, and the open/closed status ignores these days.

Easter is written in OSM as easter with an optional offset in days: easter -2 days is Good Friday, easter +1 day is Easter Monday, easter-easter +1 day is Easter Sunday and Monday. These offsets are not understood today:

  • The offset is dropped, so every such day is shown simply as "Easter".
  • A number from the offset is taken for a day of the month when the rule also has a month, and the rule breaks apart. The part of the rule before Easter loses its "closed".
  • A + in front of the offset is taken for an open end of a time range (as in 18:00+), which turns easter +1 day into a time.
  • Days with Easter never change the status, not even a plain easter off: a place that closes on Good Friday is shown as open.

Examples from real data (Android, English):

Place opening_hours Shown in the card
Alter Peter, Munich …; Jan 01,easter -2 days,easter -47 days,Dec 25 off Jan 1 Easter, Dec 25 closed
Wimmer bakery, Munich …; Jan 01,easter-easter +1 day,Dec 25-26: off Jan 1 We, Dec 25, Dec 26 closed
Haus der Wannseekonferenz, Berlin Mo-Su 10:00-18:00; …; easter -2 days off; … Easter closed
Kocaman bakery, Bonn …; easter -2 days off; easter -1 day off; easter off; easter +1 day off four times Easter closed

Status for the same places in 2027:

Place Day Shown Expected
Alter Peter Good Friday, Mar 26 open closed
Alter Peter Jan 1 open closed
Wimmer Jan 1 open closed
Haus der Wannseekonferenz Good Friday, Mar 26 open closed

The card text above is from Android. The status is computed the same way on Android and on the web. iOS reads opening hours with its own copy of the same logic; it was not checked.

Which Easter

  • The OSM opening hours specification has one variable date, easter, and does not say which Easter it is.
  • The reference library opening_hours.js treats easter in a tag as Western Easter, computed by the Gregorian calendar. Orthodox Easter exists there only inside its own public holiday tables for Orthodox countries (Ukraine, Greece, Romania, Bulgaria, Serbia, Georgia, Belarus); it cannot be written in a tag.
  • The dates differ in most years: 2026 Apr 5 (Western) vs Apr 12 (Orthodox), 2027 Mar 28 vs May 2, 2028 Apr 16 for both.
  • Offsets seen in OSM tags: -52, -49, -48, -47 (carnival days), -2 (Good Friday), -1 (Holy Saturday), +1 (Easter Monday). The reference library's holiday tables also use +39 (Ascension), +49/+50 (Pentecost), +60 (Corpus Christi).

Decision needed: Western Easter everywhere, as the reference library does, or Orthodox Easter for places in Orthodox countries, where a mapper writing easter may mean the Orthodox one.

Goal

  1. Read easter with an offset and Easter ranges correctly; the rest of the rule (fixed dates, off) keeps its meaning.
  2. Show these days correctly in the card in every language.
  3. Take Easter days into account for the open/closed status.

Scope

  • Opening hours are read the same way in three places: the Android app, the iOS app and the server used by the web. All three need the same change and must give the same result.
  • Step 1 (reading the offsets, keeping the rest of the rule intact, treating + as an open end only after a time) is small and already removes the wrong text and the lost "closed".
  • Step 2 needs a UI decision: how to show an offset, e.g. "Easter −2 days" or names of the days ("Good Friday", "Easter Monday"), and new translation strings for it.
  • Step 3 needs the Easter date of each year (a short calendar calculation) and the Western/Orthodox decision above.
  • Tests on the real tags above, including the status on Good Friday and Jan 1.

Out of scope: public and school holidays (PH, SH) in the status; they need a holiday calendar per country.

Dominant language
MDX
Stars
63
Forks
431
Avg merge
17h 10m
Merged PRs (30d)
124

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from osmandapp/web

All issues in osmandapp/web

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.