Socket
Socket
Sign inDemoInstall

@hebcal/icalendar

Package Overview
Dependencies
2
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @hebcal/icalendar

Jewish holidays and Hebrew calendar as iCalendar RFC 2445


Version published
Weekly downloads
67
increased by2133.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

ParamType
tzidstring

getPseudoISO(tzid, date) ⇒ string

Kind: global function

ParamType
tzidstring
dateDate

getTimezoneOffset(tzid, date) ⇒ number

Kind: global function

ParamType
tzidstring
dateDate

pad2(number) ⇒ string

Kind: global function

ParamType
numbernumber

timeZoneOffsetStr(tzid, date) ⇒ string

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

Kind: global function

ParamType
tzidstring
dateDate

toISOString(d) ⇒ string

Returns just the date portion as YYYY-MM-DD

Kind: global function

ParamType
dDate

toISOStringWithTimezone(date, timeStr, tzid) ⇒ string

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

Kind: global function

ParamTypeDescription
dateDate
timeStrstringmust be formatted with only hours and minutes, like "17:12"
tzidstringlike "America/New_York"

getEventCategories(ev) ⇒ Array.<string>

Returns a category and subcategory name

Kind: global function

ParamType
evEvent

icalWriteLine(res, ...str)

Kind: global function

ParamType
resstream.Writable
...strstring

formatYYYYMMDD(d) ⇒ string

Kind: global function

ParamType
dDate

formatTime(hour, min, sec) ⇒ string

Kind: global function

ParamType
hournumber | string
minnumber | string
secnumber | string

makeDtstamp(dt) ⇒ string

Returns UTC string for iCalendar

Kind: global function

ParamType
dtDate

icalWriteEvent(res, e, dtstamp, options)

Kind: global function

ParamType
resstream.Writable
eEvent
dtstampstring
optionshebcal.HebcalOptions

addOptional(arr, key, val)

Kind: global function

ParamType
arrArray.<string>
keystring
valstring

eventToIcal(e, options) ⇒ string

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

ParamType
eEvent
optionshebcal.HebcalOptions

exportHttpHeader(res, mimeType, fileName)

Kind: global function

ParamType
resstream.Writable
mimeTypestring
fileNamestring

icalWriteContents(res, events, options)

Kind: global function

ParamType
resstream.Writable
eventsArray.<Event>
optionshebcal.HebcalOptions

getDownloadFilename(options) ⇒ string

Kind: global function

ParamType
optionshebcal.HebcalOptions

eventToCsv(e, options) ⇒ string

Renders an Event as a string

Kind: global function

ParamType
eEvent
optionshebcal.HebcalOptions

csvWriteContents(res, events, options)

Kind: global function

ParamType
resstream.Writable
eventsArray.<Event>
optionshebcal.HebcalOptions

eventToFullCalendar(ev, tzid) ⇒ Object

Converts a Hebcal event to a FullCalendar.io object

Kind: global function

ParamTypeDescription
evEvent
tzidstringtimeZone identifier

Keywords

FAQs

Last updated on 05 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc