Code Monkey home page Code Monkey logo

webex-time-zones's Introduction

webex-time-zones Build Status

๐ŸŒ A small node package that helps with dealing with Webex's Timezone enumerated value

Install

$ npm install --save webex-time-zones

Usage

const webexTz = require('webex-time-zones');

webexTz.getTimezone(0) // => GMT-12:00, Dateline (Eniwetok)
webexTz.getTimezone(3) // => GMT-09:00, Alaska (Ancorage)
webexTz.getIdByOffset('11:00') // => 60
webexTz.getIdByOffset('-10:00') // => 2=

API

getTimezone(index)

Returns the name of the timezone based on the WebEx Id/Enum Value

index

Type: number
The enumerated value or index

getIdByOffet(offset)

Note:

This is an approximation (https://stackoverflow.com/tags/timezone/info) as many time zones fall into a offset. You can try using the <fallInDST> webex xml attribute to allow webex to determine the DST offset of a given timezone and datetime.

Returns the first matching WebEx Id associated with the offset

offset

Type: string (XX:XX) or number (-12 to 12)
The GMT offset it must be a valid number between -12 to 12, or valid GMT offset hours

Update Table

Update the table on the readme by running the script below: $ npm run build

Time Zones

63 Time Zones:

Index Timezone
0 GMT-12:00, Dateline (Eniwetok)
1 GMT-11:00, Samoa (Samoa)
2 GMT-10:00, Hawaii (Honolulu)
3 GMT-09:00, Alaska (Ancorage)
4 GMT-08:00, Pacific (San Jose)
5 GMT-07:00, Mountain (Arizona)
6 GMT-07:00, Mountain (Denver)
7 GMT-06:00, Central (Chicago)
8 GMT-06:00, Mexico (Mexico City,Tegucigalpa)
9 GMT-06:00, Central (Regina)
10 GMT-05:00, S. America Pacific (Bogota)
11 GMT-05:00, Eastern (New York)
12 GMT-05:00, Eastern (Indiana)
13 GMT-04:00, Atlantic (Halifax)
14 GMT-04:00, S. America Western (Caracas)
15 GMT-03:30, Newfoundland (Newfoundland)
16 GMT-03:00, S. America Eastern (Brasilia)
17 GMT-03:00, S. America Eastern (Buenos Aires)
18 GMT-02:00, Mid-Atlantic (Mid-Atlantic)
19 GMT-01:00, Azores (Azores)
20 GMT+00:00, Greenwich (Casablanca)
21 GMT+00:00, GMT (London)
22 GMT+01:00, Europe (Amsterdam)
23 GMT+01:00, Europe (Paris)
24 GMT+01:00, Europe (Prague)
25 GMT+01:00, Europe (Berlin)
26 GMT+02:00, Greece (Athens)
27 GMT+02:00, Eastern Europe (Bucharest)
28 GMT+02:00, Egypt (Cairo)
29 GMT+02:00, South Africa (Pretoria)
30 GMT+02:00, Northern Europe (Helsinki)
31 GMT+02:00, Israel (Tel Aviv)
32 GMT+03:00, Saudi Arabia (Baghdad)
33 GMT+03:00, Russian (Moscow)
34 GMT+03:00, Nairobi (Nairobi)
35 GMT+03:00, Iran (Tehran)
36 GMT+04:00, Arabian (Abu Dhabi, Muscat)
37 GMT+04:00, Baku (Baku)
38 GMT+04:00, Afghanistan (Kabul)
39 GMT+05:00, West Asia (Ekaterinburg)
40 GMT+05:00, West Asia (Islamabad)
41 GMT+05:30, India (Bombay)
42 GMT+06:00, Columbo (Columbo)
43 GMT+06:00, Central Asia (Almaty)
44 GMT+07:00, Bangkok (Bangkok)
45 GMT+08:00, China (Beijing)
46 GMT+08:00, Australia Western (Perth)
47 GMT+08:00, Singapore (Singapore)
48 GMT+08:00, Taipei (Hong Kong)
49 GMT+09:00, Tokyo (Tokyo)
50 GMT+09:00, Korea (Seoul)
51 GMT+09:30, Yakutsk (Yakutsk)
52 GMT+09:30, Australia Central (Adelaide)
53 GMT+09:30, Australia Central (Darwin)
54 GMT+10:00, Australia Eastern (Brisbane)
55 GMT+10:00, Australia Eastern (Sydney)
56 GMT+10:00, West Pacific (Guam)
57 GMT+10:00, Tasmania (Hobart)
58 GMT+10:00, Vladivostok (Vladivostok)
59 GMT+11:00, Central Pacific (Solomon Is)
60 GMT+12:00, New Zealand (Wellington)
61 GMT+12:00, Fiji (Fiji)
62 GMT-09:00, Alaska (Anchorage)

Related

If you found this client useful for collaboration, don't forget to star this repository and check other related open-source Cisco modules by the Innovation Edge team:

  • webex-api-client - A node module to simplify interacting with Cisco WebEx XML-based APIs from the browser or server
  • rrule-to-webex - Converts a RRULE (iCalendar RFC-5545) to Cisco's WebEx recurrence repeat XML tree.
  • cisco-tp-client - A node API client to ease interactions with Cisco WebEx Telepresence-enabled endpoints / codecs
  • webex-date - ๐Ÿ•ฐ Convert a JavaScript date type, RFC 2822, ISO-8601 to the WebEx XML API supported format.
  • webex-enum-types - ๐Ÿญ A JSON mapping of enumerated types for Cisco's WebEx XML API

License

MIT ยฉ Cisco Innovation Edge

webex-time-zones's People

Contributors

brh55 avatar dogeared avatar saintmac avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

webex-time-zones's Issues

Does not work with summer time

If you use it in Paris in the summer, it will tell you that you are in Bucharest (1h ahead). This is because the library doesn't take into account daylight saving times

Valid offsets are not accepted

Even the example from the documentation is not accepted: '11:00'
I think the error is on that line:
const isValidOffset = serializedOffset.match(/\d{1,2}:[0|3]0/).length > 1;
It should be
const isValidOffset = serializedOffset.match(/\d{1,2}:[0|3]0/).length > 0;

Make Public

This isn't really doing anything other than reduce unnecessary work of rewriting what has been stated in the documentation. Can I make this public so I can make it accessible to my webex-client-api work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.