@hebcal/icalendar
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

hebcal-icalendar

Jewish holidays and Hebrew calendar as iCalendar RFC 2445

Installation

$ npm install @hebcal/icalendar

Synopsis

import {HebrewCalendar, Location} from '@hebcal/core';
import icalendar from '@hebcal/icalendar';

const options = {
  year: 2020,
  month: 2,
  sedrot: true,
  candlelighting: true,
  location: Location.lookup('Hawaii'),
};
const events = HebrewCalendar.calendar(options);
console.log(icalendar.eventsToIcalendar(ev, options));

Constants

icalendar

Main interface to hebcal/icalendar

Functions

getFormatter(tzid)Intl.DateTimeFormat
getPseudoISO(tzid, date)string
getTimezoneOffset(tzid, date)number
pad2(number)string
timeZoneOffsetStr(tzid, date)string

Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")

toISOString(d)string

Returns just the date portion as YYYY-MM-DD

toISOStringWithTimezone(date, timeStr, tzid)string

Returns a string like "2018-09-01T12:30:00-05:00'"

getEventCategories(ev)Array.<string>

Returns a category and subcategory name

icalWriteLine(res, ...str)
formatYYYYMMDD(d)string
formatTime(hour, min, sec)string
makeDtstamp(dt)string

Returns UTC string for iCalendar

icalWriteEvent(res, e, dtstamp, options)
addOptional(arr, key, val)
eventToIcal(e, options)string
exportHttpHeader(res, mimeType, fileName)
icalWriteContents(res, events, options)
getDownloadFilename(options)string
eventToCsv(e, options)string

Renders an Event as a string

csvWriteContents(res, events, options)
eventToFullCalendar(ev, tzid)Object

Converts a Hebcal event to a FullCalendar.io object

icalendar

Main interface to hebcal/icalendar

Kind: global constant

getFormatter(tzid) ⇒ Intl.DateTimeFormat

Kind: global function

Param Type
tzid string

getPseudoISO(tzid, date) ⇒ string

Kind: global function

Param Type
tzid string
date Date

getTimezoneOffset(tzid, date) ⇒ number

Kind: global function

Param Type
tzid string
date Date

pad2(number) ⇒ string

Kind: global function

Param Type
number number

timeZoneOffsetStr(tzid, date) ⇒ string

Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")

Kind: global function

Param Type
tzid string
date Date

toISOString(d) ⇒ string

Returns just the date portion as YYYY-MM-DD

Kind: global function

Param Type
d Date

toISOStringWithTimezone(date, timeStr, tzid) ⇒ string

Returns a string like "2018-09-01T12:30:00-05:00'"

Kind: global function

Param Type Description
date Date
timeStr string must be formatted with only hours and minutes, like "17:12"
tzid string like "America/New_York"

getEventCategories(ev) ⇒ Array.<string>

Returns a category and subcategory name

Kind: global function

Param Type
ev Event

icalWriteLine(res, ...str)

Kind: global function

Param Type
res stream.Writable
...str string

formatYYYYMMDD(d) ⇒ string

Kind: global function

Param Type
d Date

formatTime(hour, min, sec) ⇒ string

Kind: global function

Param Type
hour number | string
min number | string
sec number | string

makeDtstamp(dt) ⇒ string

Returns UTC string for iCalendar

Kind: global function

Param Type
dt Date

icalWriteEvent(res, e, dtstamp, options)

Kind: global function

Param Type
res stream.Writable
e Event
dtstamp string
options hebcal.HebcalOptions

addOptional(arr, key, val)

Kind: global function

Param Type
arr Array.<string>
key string
val string

eventToIcal(e, options) ⇒ string

Kind: global function
Returns: string - multi-line result, delimited by \r\n

Param Type
e Event
options hebcal.HebcalOptions

exportHttpHeader(res, mimeType, fileName)

Kind: global function

Param Type
res stream.Writable
mimeType string
fileName string

icalWriteContents(res, events, options)

Kind: global function

Param Type
res stream.Writable
events Array.<Event>
options hebcal.HebcalOptions

getDownloadFilename(options) ⇒ string

Kind: global function

Param Type
options hebcal.HebcalOptions

eventToCsv(e, options) ⇒ string

Renders an Event as a string

Kind: global function

Param Type
e Event
options hebcal.HebcalOptions

csvWriteContents(res, events, options)

Kind: global function

Param Type
res stream.Writable
events Array.<Event>
options hebcal.HebcalOptions

eventToFullCalendar(ev, tzid) ⇒ Object

Converts a Hebcal event to a FullCalendar.io object

Kind: global function

Param Type Description
ev Event
tzid string timeZone identifier

Package Sidebar

Install

npm i @hebcal/icalendar@2.0.2

Version

2.0.2

License

BSD-2-Clause

Unpacked Size

195 kB

Total Files

6

Last publish

Collaborators

  • mjradwin