@hebcal/icalendar
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -39,3 +39,3 @@ 'use strict'; | ||
var leyning$1 = _interopDefault(leyning); | ||
var leyn = _interopDefault(leyning); | ||
@@ -93,3 +93,3 @@ const _formatters = {}; | ||
var Chanukah="The Jewish festival of rededication, also known as the Festival of Lights. Sometimes spelled Hanukkah, Chanukkah, Hanukah, or Hannukah";var Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";var Purim="Purim is one of the most joyous and fun holidays on the Jewish calendar. It commemorates a time when the Jewish people living in Persia were saved from extermination";var Shavuot="Festival of Weeks, commemorates the giving of the Torah at Mount Sinai";var Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";var Sukkot="Feast of Tabernacles";var holidayDescription = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot","Lag BaOmer":"33rd day of counting the Omer","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Rosh Chodesh Adar I":"Beginning of new Hebrew month of Adar I (on leap years). Adar I is the 12th month of the Hebrew year. Corresponds to February or March on the Gregorian calendar","Rosh Chodesh Adar II":"Beginning of new Hebrew month of Adar II (on leap years). Adar II (sometimes \"Adar Bet\" or \"Adar Sheni\") is the 13th month of the Hebrew year, ocurring only on leap years. Corresponds to February or March on the Gregorian calendar","Rosh Chodesh Adar":"Beginning of new Hebrew month of Adar. Adar is the 12th month of the Hebrew year. Corresponds to February or March on the Gregorian calendar","Rosh Chodesh Av":"Beginning of new Hebrew month of Av. Av is the 5th month of the Hebrew year. Corresponds to July or August on the Gregorian calendar","Rosh Chodesh Cheshvan":"Beginning of new Hebrew month of Cheshvan. Cheshvan is the 8th month of the Hebrew year. Corresponds to October or November on the Gregorian calendar","Rosh Chodesh Elul":"Beginning of new Hebrew month of Elul. Elul is the 6th month of the Hebrew year. Corresponds to August or September on the Gregorian calendar","Rosh Chodesh Iyyar":"Beginning of new Hebrew month of Iyyar. Iyyar (somtimes transliterated Iyar) is the 2nd month of the Hebrew year. Corresponds to April or May on the Gregorian calendar","Rosh Chodesh Kislev":"Beginning of new Hebrew month of Kislev. Kislev is the 9th month of the Hebrew year. Corresponds to November or December on the Gregorian calendar","Rosh Chodesh Nisan":"Beginning of new Hebrew month of Nisan. Nisan (sometimes transliterated Nissan) is the 1st month of the Hebrew year. rresponds to March or April on the Gregorian calendar","Rosh Chodesh Sh'vat":"Beginning of new Hebrew month of Sh'vat. Sh'vat (sometimes transliterated Shevat) is the 11th month of the Hebrew year. Corresponds to January or February on the Gregorian calendar","Rosh Chodesh Sivan":"Beginning of new Hebrew month of Sivan. Sivan is the 3rd month of the Hebrew year. Corresponds to May or June on the Gregorian calendar","Rosh Chodesh Tamuz":"Beginning of new Hebrew month of Tamuz. Tamuz (sometimes transliterated Tammuz) is the 4th month of the Hebrew year. Corresponds to June or July on the Gregorian calendar","Rosh Chodesh Tevet":"Beginning of new Hebrew month of Tevet. Tevet is the 10th month of the Hebrew year. Corresponds to December or January on the Gregorian calendar","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Shabbat Chazon":"Shabbat before Tish'a B'Av (Shabbat of Prophecy/Shabbat of Vision)","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan","Shabbat HaGadol":"Shabbat before Pesach","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar","Shabbat Shuva":"Shabbat that falls between Rosh Hashanah and Yom Kippur (Shabbat of Returning)","Shabbat Zachor":"Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly","Shushan Purim":"Purim celebrated in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av, fast commemorating the destruction of the two Temples","Tu B'Av":"minor Jewish holiday of love, observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees","Tzom Gedaliah":"Fast of the Seventh Month, commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Note that Hebcal displays modern holidays like Yom HaAtzma'ut according to the Israeli schedule. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always preceeds it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Note that Hebcal displays modern holidays like Yom HaZikaron according to the Israeli schedule. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"}; | ||
var Chanukah="The Jewish festival of rededication, also known as the Festival of Lights. Sometimes spelled Hanukkah, Chanukkah, Hanukah, or Hannukah";var Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";var Purim="Purim is one of the most joyous and fun holidays on the Jewish calendar. It commemorates a time when the Jewish people living in Persia were saved from extermination";var Shavuot="Festival of Weeks, commemorates the giving of the Torah at Mount Sinai";var Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";var Sukkot="Feast of Booths";var holidayDescription = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot","Lag BaOmer":"33rd day of counting the Omer","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Rosh Chodesh Adar I":"Beginning of new Hebrew month of Adar I (on leap years). Adar I is the 12th month of the Hebrew year. Corresponds to February or March on the Gregorian calendar","Rosh Chodesh Adar II":"Beginning of new Hebrew month of Adar II (on leap years). Adar II (sometimes \"Adar Bet\" or \"Adar Sheni\") is the 13th month of the Hebrew year, ocurring only on leap years. Corresponds to February or March on the Gregorian calendar","Rosh Chodesh Adar":"Beginning of new Hebrew month of Adar. Adar is the 12th month of the Hebrew year. Corresponds to February or March on the Gregorian calendar","Rosh Chodesh Av":"Beginning of new Hebrew month of Av. Av is the 5th month of the Hebrew year. Corresponds to July or August on the Gregorian calendar","Rosh Chodesh Cheshvan":"Beginning of new Hebrew month of Cheshvan. Cheshvan is the 8th month of the Hebrew year. Corresponds to October or November on the Gregorian calendar","Rosh Chodesh Elul":"Beginning of new Hebrew month of Elul. Elul is the 6th month of the Hebrew year. Corresponds to August or September on the Gregorian calendar","Rosh Chodesh Iyyar":"Beginning of new Hebrew month of Iyyar. Iyyar (somtimes transliterated Iyar) is the 2nd month of the Hebrew year. Corresponds to April or May on the Gregorian calendar","Rosh Chodesh Kislev":"Beginning of new Hebrew month of Kislev. Kislev is the 9th month of the Hebrew year. Corresponds to November or December on the Gregorian calendar","Rosh Chodesh Nisan":"Beginning of new Hebrew month of Nisan. Nisan (sometimes transliterated Nissan) is the 1st month of the Hebrew year. rresponds to March or April on the Gregorian calendar","Rosh Chodesh Sh'vat":"Beginning of new Hebrew month of Sh'vat. Sh'vat (sometimes transliterated Shevat) is the 11th month of the Hebrew year. Corresponds to January or February on the Gregorian calendar","Rosh Chodesh Sivan":"Beginning of new Hebrew month of Sivan. Sivan is the 3rd month of the Hebrew year. Corresponds to May or June on the Gregorian calendar","Rosh Chodesh Tamuz":"Beginning of new Hebrew month of Tamuz. Tamuz (sometimes transliterated Tammuz) is the 4th month of the Hebrew year. Corresponds to June or July on the Gregorian calendar","Rosh Chodesh Tevet":"Beginning of new Hebrew month of Tevet. Tevet is the 10th month of the Hebrew year. Corresponds to December or January on the Gregorian calendar","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Shabbat Chazon":"Shabbat before Tish'a B'Av (Shabbat of Prophecy/Shabbat of Vision)","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan","Shabbat HaGadol":"Shabbat before Pesach","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar","Shabbat Shuva":"Shabbat that falls between Rosh Hashanah and Yom Kippur (Shabbat of Returning)","Shabbat Zachor":"Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly","Shushan Purim":"Purim celebrated in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av, fast commemorating the destruction of the two Temples","Tu B'Av":"minor Jewish holiday of love, observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees","Tzom Gedaliah":"Fast of the Seventh Month, commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Note that Hebcal displays modern holidays like Yom HaAtzma'ut according to the Israeli schedule. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always preceeds it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Note that Hebcal displays modern holidays like Yom HaZikaron according to the Israeli schedule. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"}; | ||
@@ -125,4 +125,4 @@ /** | ||
if (options.location) { | ||
const name = options.location.getShortName(); | ||
fileName += '_' + makeAnchor(name); | ||
const name = options.location.zip || options.location.asciiname || options.location.getShortName(); | ||
fileName += '_' + name.replace(/[^A-Za-z0-9]/g, '_'); | ||
} | ||
@@ -145,2 +145,18 @@ | ||
/** | ||
* @param {number} number | ||
* @return {string} | ||
*/ | ||
function pad4(number) { | ||
if (number < 10) { | ||
return '000' + number; | ||
} else if (number < 100) { | ||
return '00' + number; | ||
} else if (number < 1000) { | ||
return '0' + number; | ||
} | ||
return String(number); | ||
} | ||
/** | ||
* Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow") | ||
@@ -167,3 +183,3 @@ * @param {string} tzid | ||
function toISOString(d) { | ||
return d.getFullYear() + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate()); | ||
return pad4(d.getFullYear()) + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate()); | ||
} | ||
@@ -268,3 +284,3 @@ /** | ||
if (options.isHebrewYear) { | ||
if (options.isHebrewYear || events.length == 0) { | ||
title += ' ' + options.year; | ||
@@ -391,18 +407,19 @@ } else { | ||
* @param {Event[]} events | ||
* @param {HebcalOptions} options | ||
* @param {HebrewCalendar.Options} options | ||
* @param {boolean} [leyning=true] | ||
* @return {Object} | ||
*/ | ||
function eventsToClassicApi(events, options) { | ||
function eventsToClassicApi(events, options, leyning = true) { | ||
const result = { | ||
date: new Date().toISOString(), | ||
title: getCalendarTitle(events, options) | ||
title: getCalendarTitle(events, options), | ||
date: new Date().toISOString() | ||
}; | ||
const location = options.location; | ||
const tzid = location && location.getTzid(); | ||
if (location && location.name) { | ||
if (typeof location === 'object' && typeof location.name === 'string') { | ||
result.location = { | ||
city: location.getName(), | ||
tzid: tzid, | ||
title: location.getName(), | ||
city: location.getShortName(), | ||
tzid: location.getTzid(), | ||
latitude: location.getLatitude(), | ||
@@ -413,5 +430,14 @@ longitude: location.getLongitude(), | ||
}; | ||
['admin1', 'asciiname', 'geo', 'zip', 'state', 'geonameid'].forEach(k => { | ||
if (location[k]) { | ||
result.location[k] = location[k]; | ||
} | ||
}); | ||
} else { | ||
result.location = { | ||
geo: 'none' | ||
}; | ||
} | ||
result.items = events.map(ev => eventToClassicApiObject(ev, tzid, options.il)); | ||
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning)); | ||
return result; | ||
@@ -422,14 +448,26 @@ } | ||
* @param {Event} ev | ||
* @param {string} tzid timeZone identifier | ||
* @param {boolean} il true if Israel | ||
* @param {HebrewCalendar.Options} options | ||
* @param {boolean} [leyning=true] | ||
* @return {Object} | ||
*/ | ||
function eventToClassicApiObject(ev, tzid, il) { | ||
function eventToClassicApiObject(ev, options, leyning = true) { | ||
const attrs = ev.getAttrs(); | ||
const timed = Boolean(attrs.eventTime); | ||
const dt = ev.getDate().greg(); | ||
const hd = ev.getDate(); | ||
const dt = hd.greg(); | ||
const tzid = typeof options.location === 'object' ? options.location.getTzid() : 'UTC'; | ||
const date = timed ? toISOStringWithTimezone(dt, attrs.eventTimeStr, tzid) : toISOString(dt); | ||
const categories = getEventCategories(ev); | ||
const title = ev.render(); | ||
let title = ev.render(); | ||
if (timed) { | ||
const colon = title.indexOf(': '); | ||
if (colon != -1) { | ||
const time = core__default.HebrewCalendar.reformatTimeStr(attrs.eventTimeStr, 'pm', options); | ||
title = title.substring(0, colon) + ': ' + time; | ||
} | ||
} | ||
const result = { | ||
@@ -462,11 +500,18 @@ title: title, | ||
if (!timed) { | ||
const isParsha = ev.getFlags() == core__default.flags.PARSHA_HASHAVUA; | ||
const reading = isParsha ? leyning$1.getLeyningForParshaHaShavua(ev, il) : leyning$1.getLeyningForHoliday(ev, il); | ||
if (leyning) { | ||
const il = options.il; | ||
const isParsha = ev.getFlags() == core__default.flags.PARSHA_HASHAVUA; | ||
const reading = isParsha ? leyn.getLeyningForParshaHaShavua(ev, il) : leyn.getLeyningForHoliday(ev, il); | ||
if (reading) { | ||
result.leyning = formatLeyningResult(reading); | ||
if (reading) { | ||
result.leyning = formatLeyningResult(reading); | ||
const hyear = hd.getFullYear(); | ||
if (isParsha && !il) { | ||
const triReading = leyning$1.getTriennialForParshaHaShavua(ev); | ||
result.leyning.triennial = formatAliyot({}, triReading); | ||
if (isParsha && !il && hyear >= 5745 && hyear <= 5830) { | ||
const triReading = leyn.getTriennialForParshaHaShavua(ev); | ||
if (triReading) { | ||
result.leyning.triennial = formatAliyot({}, triReading); | ||
} | ||
} | ||
} | ||
@@ -500,4 +545,7 @@ } | ||
const aliyah = aliyot[num]; | ||
const k = num == 'M' ? 'maftir' : num; | ||
result[k] = leyning$1.formatAliyahWithBook(aliyah); | ||
if (typeof aliyah !== 'undefined') { | ||
const k = num == 'M' ? 'maftir' : num; | ||
result[k] = leyn.formatAliyahWithBook(aliyah); | ||
} | ||
}); | ||
@@ -507,3 +555,3 @@ return result; | ||
/** | ||
* @param {leyning.Leyning} reading | ||
* @param {leyn.Leyning} reading | ||
* @return {Object} | ||
@@ -515,4 +563,7 @@ */ | ||
const result = {}; | ||
result.torah = reading.summary; | ||
if (reading.summary) { | ||
result.torah = reading.summary; | ||
} | ||
if (reading.haftara) { | ||
@@ -526,3 +577,5 @@ result.haftarah = reading.haftara; | ||
formatAliyot(result, reading.fullkriyah); | ||
if (reading.fullkriyah) { | ||
formatAliyot(result, reading.fullkriyah); | ||
} | ||
@@ -580,2 +633,4 @@ if (reading.reason) { | ||
* @param {Location} location | ||
* @param {string} mainUrl | ||
* @param {string} selfUrl | ||
* @param {string} [lang] language such as 'he' (default 'en-US') | ||
@@ -587,7 +642,6 @@ * @param {boolean} [evPubDate] if true, use event time as pubDate (false uses lastBuildDate) | ||
function eventsToRss(events, location, lang = 'en-US', evPubDate = true) { | ||
function eventsToRss(events, location, mainUrl, selfUrl, lang = 'en-US', evPubDate = true) { | ||
const cityDescr = location.getName(); | ||
const thisYear = new Date().getFullYear(); | ||
const title = 'Shabbat Times for ' + cityDescr; | ||
const mainUrl = 'https://hebcal.com/bogus?a=b'; | ||
const lastBuildDate = new Date().toUTCString(); | ||
@@ -600,2 +654,4 @@ const dayFormat = new Intl.DateTimeFormat('en-US', { | ||
}); | ||
mainUrl = mainUrl.replace(/&/g, '&'); | ||
selfUrl = selfUrl.replace(/&/g, '&'); | ||
let str = `<?xml version="1.0" encoding="UTF-8"?> | ||
@@ -606,3 +662,3 @@ <rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:atom="http://www.w3.org/2005/Atom"> | ||
<link>${mainUrl}&${utmParam}</link> | ||
<atom:link href="${mainUrl}&cfg=r" rel="self" type="application/rss+xml" /> | ||
<atom:link href="${selfUrl}" rel="self" type="application/rss+xml" /> | ||
<description>Weekly Shabbat candle lighting times for ${cityDescr}</description> | ||
@@ -620,5 +676,27 @@ <language>${lang}</language> | ||
/** | ||
* @private | ||
* @param {Event} ev | ||
* @param {boolean} evPubDate | ||
* @param {Date} evDate | ||
* @param {string} lastBuildDate | ||
* @return {string} | ||
*/ | ||
function getPubDate(ev, evPubDate, evDate, lastBuildDate) { | ||
if (evPubDate) { | ||
const dt = ev.getAttrs().eventTime; | ||
if (dt) { | ||
return dt.toUTCString(); | ||
} | ||
return evDate.toUTCString().replace(/ \S+ GMT$/, ' 00:00:00 GMT'); | ||
} | ||
return lastBuildDate; | ||
} | ||
/** | ||
* @param {Event} ev | ||
* @param {boolean} evPubDate | ||
* @param {string} lastBuildDate | ||
* @param {Intl.DateTimeFormat} dayFormat | ||
@@ -629,6 +707,7 @@ * @param {Location} location | ||
function eventToRssItem(ev, evPubDate, lastBuildDate, dayFormat, location) { | ||
const subj = ev.render(); | ||
let subj = ev.render(); | ||
const evDate = ev.getDate().greg(); | ||
const pubDate = evPubDate ? evDate.toUTCString() : lastBuildDate; | ||
const pubDate = getPubDate(ev, evPubDate, evDate, lastBuildDate); | ||
const linkGuid = getLinkAndGuid(ev); | ||
@@ -640,2 +719,18 @@ const link = linkGuid[0]; | ||
const cat0 = categories[0]; | ||
const attrs = ev.getAttrs(); | ||
if (typeof attrs.eventTimeStr === 'string') { | ||
const colon = subj.indexOf(': '); | ||
if (colon != -1) { | ||
const options = { | ||
location, | ||
il: location.getIsrael(), | ||
locale: core__default.Locale.getLocaleName() | ||
}; | ||
const time = core__default.HebrewCalendar.reformatTimeStr(attrs.eventTimeStr, 'pm', options); | ||
subj = subj.substring(0, colon) + ': ' + time; | ||
} | ||
} | ||
const geoTags = cat0 == 'candles' ? `<geo:lat>${location.getLatitude()}</geo:lat>\n<geo:long>${location.getLongitude()}</geo:long>\n` : ''; | ||
@@ -738,2 +833,3 @@ return `<item> | ||
exports.pad2 = pad2; | ||
exports.pad4 = pad4; | ||
exports.timeZoneOffsetStr = timeZoneOffsetStr; | ||
@@ -759,5 +855,6 @@ exports.toISOString = toISOString; | ||
var dist_14 = dist.pad2; | ||
var dist_15 = dist.timeZoneOffsetStr; | ||
var dist_16 = dist.toISOString; | ||
var dist_17 = dist.toISOStringWithTimezone; | ||
var dist_15 = dist.pad4; | ||
var dist_16 = dist.timeZoneOffsetStr; | ||
var dist_17 = dist.toISOString; | ||
var dist_18 = dist.toISOStringWithTimezone; | ||
@@ -785,14 +882,2 @@ /* eslint-disable max-len */ | ||
/** | ||
* @private | ||
* @param {number|string} hour | ||
* @param {number|string} min | ||
* @param {number|string} sec | ||
* @return {string} | ||
*/ | ||
function formatTime(hour, min, sec) { | ||
return dist_14(hour) + dist_14(min) + dist_14(sec); | ||
} | ||
/** | ||
* Returns UTC string for iCalendar | ||
@@ -929,8 +1014,10 @@ * @private | ||
let [hour, minute] = attrs.eventTimeStr.split(':'); | ||
hour = +hour; | ||
minute = +minute; | ||
if (Number(hour) < 12) { | ||
hour = 12 + Number(hour); | ||
if (hour < 12) { | ||
hour += 12; | ||
} | ||
startDate += 'T' + formatTime(hour, minute, 0); | ||
startDate += 'T' + dist_14(hour) + dist_14(minute) + '00'; | ||
endDate = startDate; | ||
@@ -937,0 +1024,0 @@ dtargs = `;TZID=${options.location.tzid}`; // replace "Candle lighting: 15:34" with shorter title |
{ | ||
"name": "@hebcal/icalendar", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"author": "Michael J. Radwin (https://github.com/mjradwin)", | ||
@@ -26,5 +26,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@hebcal/core": "^2.1.1", | ||
"@hebcal/leyning": "^2.1.1", | ||
"@hebcal/rest-api": "^2.1.3", | ||
"@hebcal/core": "^2.2.3", | ||
"@hebcal/leyning": "^2.1.2", | ||
"@hebcal/rest-api": "^2.3.3", | ||
"md5": "^2.2.1" | ||
@@ -60,13 +60,13 @@ }, | ||
"@ava/babel": "^1.0.1", | ||
"@babel/core": "^7.10.4", | ||
"@babel/core": "^7.10.5", | ||
"@babel/polyfill": "^7.10.4", | ||
"@babel/preset-env": "^7.10.4", | ||
"@babel/register": "^7.10.4", | ||
"@rollup/plugin-babel": "^5.0.4", | ||
"@babel/register": "^7.10.5", | ||
"@rollup/plugin-babel": "^5.1.0", | ||
"@rollup/plugin-commonjs": "^12.0.0", | ||
"@rollup/plugin-node-resolve": "^8.1.0", | ||
"@rollup/plugin-node-resolve": "^8.4.0", | ||
"ava": "^3.8.2", | ||
"eslint": "^7.3.1", | ||
"eslint": "^7.5.0", | ||
"eslint-config-google": "^0.14.0", | ||
"jsdoc": "^3.6.4", | ||
"jsdoc": "^3.6.5", | ||
"jsdoc-to-markdown": "^5.0.3", | ||
@@ -73,0 +73,0 @@ "rollup": "^1.29.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51340
1028
Updated@hebcal/core@^2.2.3
Updated@hebcal/leyning@^2.1.2
Updated@hebcal/rest-api@^2.3.3