osagai-time

0.2.1 • Public • Published

osagai-time 🕰🌎

Formats the timestamp as a localized string in the user's browser.

Install

Package managers

npm

npm install osagai-time

yarn

yarn add osagai-time

CDN

Javascript Module

import 'https://unpkg.com/osagai-time@0.1.0/dist/osagai-time.mjs'

Script tag

<script src="https://unpkg.com/osagai-time@0.1.0/dist/osagai-time.umd.js"></script>

Usage

<local-time
  datetime="2019-01-01T16:30:00-08:00"
  month="short"
  day="numeric"
  year="numeric"
  hour="numeric"
  minute="numeric"
>
  January 2, 2019 4:30PM PDT
</local-time>

Result: 2 Jan 2019 01:30

See Also

The implementation is just a translation of custom elements from github/time-elements into Osagai components. Thanks to @github for open-sourcing amazing custom elements allowing that work.

Readme

Keywords

none

Package Sidebar

Install

npm i osagai-time

Weekly Downloads

4

Version

0.2.1

License

MIT

Unpacked Size

120 kB

Total Files

19

Last publish

Collaborators

  • henriquelimas