Skip to content

Add tachanun field to API output#746

Merged
mjradwin merged 1 commit into
hebcal:mainfrom
sdubois:feat/tachanun-api
May 26, 2026
Merged

Add tachanun field to API output#746
mjradwin merged 1 commit into
hebcal:mainfrom
sdubois:feat/tachanun-api

Conversation

@sdubois
Copy link
Copy Markdown
Contributor

@sdubois sdubois commented May 24, 2026

The purpose of the pull request is to expose the existing @hebcal/core tachanun calculation in @hebcal/rest-api

I thought it would be useful if this was available so people who make use of this service can also know when tachanun is said. Here are some example outputs:

Diaspora, January 2, 2026 (2026-01-02, Friday before Shabbat):

"tachanun": {
  "shacharit": true,
  "mincha": false,
  "allCongs": true
}

Diaspora, June 1, 2026 (2026-06-01, ordinary weekday):

"tachanun": {
  "shacharit": true,
  "mincha": true,
  "allCongs": true
}

Scope: add optional top-level tachanun field when options.tachanun is true and the response covers a single day
Test coverage: added formatter test for 2026-05-21

@sonarqubecloud
Copy link
Copy Markdown

@mjradwin
Copy link
Copy Markdown
Member

Thank you for this PR! Will review and test and get back to you

@sdubois
Copy link
Copy Markdown
Contributor Author

sdubois commented May 26, 2026

Thanks! I think there's also opportunity here to make the tachanun output more useful if you are open to it. Rather than just providing a boolean, it could also include a reason why tachanun is not said (eg, "chol hamoed"). For now I left this PR simple to just integrate with the existing functionality.

@mjradwin
Copy link
Copy Markdown
Member

Do you want to attempt the change to @hebcal/core library (https://github.com/hebcal/hebcal-es6/blob/main/src/tachanun.ts) first to revise TachanunResult to add the tachanun reasons? To keep compatibility you'd want to keep the three existing boolean and then add additional string fields (or some enum if it makes more sense to do so)

@mjradwin mjradwin merged commit 0df15bd into hebcal:main May 26, 2026
3 checks passed
mjradwin added a commit that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants