timezone-elements

0.1.0 • Public • Published

Web Component to format an ISO8601-formatted time in the local timezone, assuming the timezone is different than the timestamp.

<time-local datetime="2016-11-10T10:00:00-08:00"></time-local>

If the user's timezone is not UTC-8, then the time-local element will display the time and optional weekday of the local timezone. For example, if the user is in UTC+10, they'll see "Fri 6:00"; but if the user is in UTC-8, then the element will be left empty.

This element is useful for events which want to publish in 'event time' but provide an optional local device fallback.

Requirements

You'll need to use this in a browser which supports Web Components or include an available polyfill.

Package Sidebar

Install

npm i timezone-elements

Weekly Downloads

0

Version

0.1.0

License

Apache-2.0

Last publish

Collaborators

  • samthor