Left: | ||
Right: |
LEFT | RIGHT |
---|---|
(no file at all) | |
1 /* globals module, require */ | |
2 | |
3 "use strict"; | |
4 | |
5 const IOElement = require("../js/io-element"); | |
6 | |
7 class IOClock extends IOElement | |
8 { | |
9 connectedCallback() | |
10 { | |
11 this._timer = setInterval(() => this.render(), 1000); | |
12 } | |
13 | |
14 disconnectedCallback() | |
15 { | |
16 clearInterval(this._timer); | |
17 } | |
18 | |
19 render() | |
20 { | |
21 this.html` | |
22 ${{i18n: "io_clock"}} | |
23 @${(new Date()).toLocaleTimeString()} | |
24 `; | |
25 } | |
26 } | |
27 | |
28 IOClock.define("io-clock"); | |
LEFT | RIGHT |