shaf-timeago

Custom element for 'ago' and 'in' time formatting

Usage no npm install needed!

<script type="module">
  import shafTimeago from 'https://cdn.skypack.dev/shaf-timeago';
</script>

README

It's easy peasy

<!-- Custom Elements v1 polyfill (2.7KB gzipped) -->
<script src="https://unpkg.com/@webcomponents/custom-elements@1.0.0-alpha.3"></script>
<!-- our custom element's source (1.7KB gzipped) -->
<script src="https://unpkg.com/shaf-timeago@2.0.0"></script>

Usage

<shaf-timeago>
  <time>2017-01-07T21:23:35.587Z</time>
</shaf-timeago>

This still shows if JavaScript is turned off.

Dependencies