Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

timzones-ical-library

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timzones-ical-library

Easy direct access to the most recent official timezone information for iCalendar files

  • 1.0.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Add to Calendar TimeZone iCal Library


Add to Calendar TimeZones iCal Library

The tool to convert the IANA (formerly Olson) timezone database files into VTIMEZONE blocks, compatible with the iCalendar specification (RFC2445).

It is based on the awesome tool by Damon Chaplin (github.com/libical/vzic), but only provides the VTIMEZONE part to easily put this into any other iCal generator (like the add-to-calendar-button). It is built to be used standalone or as JavaScript module, hosted as npm package.





📦 Installation / Setup

1. Update it

This step is only relevant if you want to build the package from source!

(Requires Node.js as well as Linux as operating system.)

Run

sudo sh update-tzdata.sh tzVersionNumber

with tzVersionNumber being the version of the timezone database you want to use (e.g. sudo sh update-tzdata.sh 2022c).


2. Load it

There are basically 2 options how you can use the script.

A. VanillaJS

You can use the VanillaJS version from the dist folder or simply the jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/timzones-ical-library"></script>
B. npm package
npm install timezones-ical-library

After the installation, you can then either ...

  • require the package (commonJS) or ...
  • import the module (ES) via import { tzlib_get_ical_block } from 'timezones-ical-library';.

3. Use it

Use tzlib_get_ical_block(tzName) function to return the proper iCal VTIMEZONE block for a given timezone string (tzName).

Use tzlib_get_timezones() to retrieve a list of all available timezone strings. You can pass true to retrieve a JSON formatted string instead of an array.





🙌 Contributing

Anyone is welcome to contribute, but mind the guidelines:


Licensed under GPL-3.0.


⚡ Changelog (without minor changes and fixes)

  • v1.0 : initial release

Keywords

FAQs

Package last updated on 27 Aug 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc