Skip to content

Commit

Permalink
Don't generate hdate for timed events
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed May 9, 2022
1 parent aba0f7f commit 9594742
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/rest-api",
"version": "3.15.0",
"version": "3.15.1",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"hebcal"
Expand Down
6 changes: 4 additions & 2 deletions src/classic-rest-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export function eventToClassicApiObject(ev, options, leyning=true) {
const result = {
title: title,
date: date,
hdate: hd.toString(),
category: categories[0],
};
if (!timed) {
result.hdate = hd.toString();
}
result.category = categories[0];
if (categories.length > 1) {
result.subcat = categories[1];
}
Expand Down
8 changes: 0 additions & 8 deletions src/classic-rest-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test('eventToClassicApiObject', (t) => {
const candlesExpected = {
title: 'Candle lighting: 21:17',
date: '2020-05-22T21:17:00+02:00',
hdate: '28 Iyyar 5780',
category: 'candles',
hebrew: 'הדלקת נרות',
title_orig: 'Candle lighting',
Expand Down Expand Up @@ -150,7 +149,6 @@ test('eventsToClassicApi', (t) => {
const candleLightingExpected = {
category: 'candles',
date: '2022-05-06T20:18:00-07:00',
hdate: '5 Iyyar 5782',
hebrew: 'הדלקת נרות',
title: 'Candle lighting: 8:18pm',
title_orig: 'Candle lighting',
Expand Down Expand Up @@ -235,7 +233,6 @@ test('reformat-time-usa', (t) => {
const expected = {
title: 'Candle lighting: 7:48pm',
date: '2020-05-22T19:48:00-04:00',
hdate: '28 Iyyar 5780',
category: 'candles',
title_orig: 'Candle lighting',
hebrew: 'הדלקת נרות',
Expand Down Expand Up @@ -287,7 +284,6 @@ test('chanukah-candles', (t) => {
{
title: 'Chanukah: 1 Candle',
date: '2020-12-10T16:43:00-05:00',
hdate: '24 Kislev 5781',
category: 'holiday',
subcat: 'major',
hebrew: 'חנוכה: א׳ נר',
Expand All @@ -297,7 +293,6 @@ test('chanukah-candles', (t) => {
{
title: 'Chanukah: 2 Candles',
date: '2020-12-11T15:53:00-05:00',
hdate: '25 Kislev 5781',
category: 'holiday',
subcat: 'major',
hebrew: 'חנוכה: ב׳ נרות',
Expand All @@ -307,7 +302,6 @@ test('chanukah-candles', (t) => {
{
title: 'Candle lighting: 3:53pm',
date: '2020-12-11T15:53:00-05:00',
hdate: '25 Kislev 5781',
category: 'candles',
title_orig: 'Candle lighting',
hebrew: 'הדלקת נרות',
Expand Down Expand Up @@ -361,7 +355,6 @@ test('fastStartEnd', (t) => {
{
title: 'Fast begins',
date: '2021-06-27T03:20:00-04:00',
hdate: '17 Tamuz 5781',
category: 'zmanim',
subcat: 'fast',
hebrew: 'תחילת הצום',
Expand All @@ -380,7 +373,6 @@ test('fastStartEnd', (t) => {
{
title: 'Fast ends',
date: '2021-06-27T21:07:00-04:00',
hdate: '17 Tamuz 5781',
category: 'zmanim',
subcat: 'fast',
hebrew: 'סיום הצום',
Expand Down

0 comments on commit 9594742

Please sign in to comment.