Formats the timestamp as a localized string in the user's browser.
npm install osagai-time
yarn add osagai-time
import 'https://unpkg.com/osagai-time@0.1.0/dist/osagai-time.mjs'
<script src="https://unpkg.com/osagai-time@0.1.0/dist/osagai-time.umd.js"></script>
<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
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.