A simple digital-clock component

[ This description is mirrored from README.md at github.com/telecomsante/digital-clock on 2019-05-10 ]

<digital-clock>

Published on webcomponents.org

A simple clock component, displaying the current date and time into the local format.

It's possible to set an alarm.

Quick example

<digital-clock></digital-clock>
<audio src="demo/Zen_Temple_Bell.mp3" id="alarm"></audio>
<script>
const clock = document.querySelector('digital-clock');
let now = new Date();
now.setMinutes(now.getMinutes() + 1);
now.setSeconds(0);

clock.alarm = now.toISOString();
clock.addEventListener('clock-alarm', () => {
  document.getElementById("alarm").play();
});
</script>

The component is licensed under the ISC License

Install

Link to this version
TestedReleased 10 October 2017Other
Framework Support
Polymer 2.0+
Also supported:
Polymer 1 (1.0.2)
Browser Compatibility
Install with
Release notes - Version 2.0.0

Dependencies

Polymer/polymer#^2.0.0

  • PolymerElements/iron-icon#^2.0.1
  • PolymerElements/iron-iconset-svg#^2.0.1