Directory

← Back

digital-clock

A simple digital-clock component

Author

Contributors

Rating

[ 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

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

Polymer/polymer#^2.0.0

  • PolymerElements/iron-icon#^2.0.1
  • PolymerElements/iron-iconset-svg#^2.0.1
Released
2017-10-10
Maturity
TESTED
License
Other

Compatibility

Framework
Polymer 2.0+
Polymer 1.0+ in 1.0.2
Browser
Browser Independent
Online