tease

1.0.1 • Public • Published

Tease

Pipeline

Version: 1.0.1
Master build: Master branch build status

$ npm install tease

This library provides basic time zone information with UTC and DST offsets and canonical links from the IANA Time Zone Database. It can be installed in whichever way you prefer, but I recommend NPM.

Documentation

var tease = require('tease');
 
tease.all();
// {
//     "Europe/London": {"utc":"+00:00", "dst":"+01:00", "link":null},
//     "US/Eastern": {"utc":"-05:00", "dst":"-04:00", "link":"America/New_York"},
//     "UTC": {"utc":"+00:00", "dst":"+00:00", "link":null},
//     ...
// }
 
tease.ids();
// [
//     "Europe/London",
//     "US/Eastern",
//     "UTC",
//     ...
// ]
 
tease.get('US/Eastern');
// {"utc":"-05:00", "dst":"-04:00", "link":"America/New_York"}
 
tease.get('US/Eastern', /*canonical*/ true) === tease.get('America/New_York');
// true
 
tease.utc('US/Eastern');
// "-05:00"
 
tease.dst('US/Eastern');
// "-04:00"
 
tease.has('US/Eastern');
// true
 
tease.has('Planet/Mars');
// false

Contributing

I accept contributions to the source via Pull Request, but passing unit tests must be included before it will be considered for merge.

$ curl -O https://raw.githubusercontent.com/adlawson/vagrantfiles/master/nodejs/Vagrantfile
$ vagrant up
$ vagrant ssh
cd /srv
 
$ npm test

License

The content of this library is released under the MIT License by Andrew Lawson.
You can find a copy of this license in LICENSE or at http://www.opensource.org/licenses/mit.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i tease

    Weekly Downloads

    33

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • adlawson