diff options
| author | Akshay Nair <phenax5@gmail.com> | 2021-09-14 13:34:19 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2021-09-14 13:34:19 +0530 |
| commit | f819aa3afea420925fe4c91a71a2756d5ed04b80 (patch) | |
| tree | 51485da02eda97596faf55aec4881af8134b1e72 /config/qutebrowser/homepage | |
| parent | 994bda7f51d6967087832218d7d3613f37960c9f (diff) | |
| download | nixos-config-f819aa3afea420925fe4c91a71a2756d5ed04b80.tar.gz nixos-config-f819aa3afea420925fe4c91a71a2756d5ed04b80.zip | |
qutebrowser config save
Diffstat (limited to 'config/qutebrowser/homepage')
| -rw-r--r-- | config/qutebrowser/homepage/index.html | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/config/qutebrowser/homepage/index.html b/config/qutebrowser/homepage/index.html index 0578cb0..0794c1d 100644 --- a/config/qutebrowser/homepage/index.html +++ b/config/qutebrowser/homepage/index.html @@ -36,10 +36,7 @@ children.forEach($ch => $el.appendChild($ch)); return $el; }; - const text = str => { - const $t = document.createTextNode(str); - return $t; - }; + const text = str => document.createTextNode(str); const render = ($el, $tree) => { while($el.firstChild) $el.removeChild($el.firstChild); $el.appendChild($tree); @@ -111,28 +108,24 @@ </style> <script> const $clock = $('#clock'); - - const formatTime = date => { - const format = new Intl.DateTimeFormat('en-IN', { + const formatters = { + time: new Intl.DateTimeFormat('en-IN', { hour12: true, hour: 'numeric', minute: 'numeric' - }); - - return format.format(date); - }; - const formatDate = date => { - const format = new Intl.DateTimeFormat('en-IN', { + }), + date: new Intl.DateTimeFormat('en-IN', { weekday: 'long', month: 'short', day: 'numeric', - }); - - return format.format(date); + }), }; + const formatTime = date => formatters.time.format(date); + const formatDate = date => formatters.date.format(date); + function renderDateTime() { const d = new Date(); // Update every second - setInterval(renderDateTime, 20 * 1000); + setTimeout(renderDateTime, 20 * 1000); render($clock, h('div', {}, [ h('div', { className: 'home-time' }, [ text(formatTime(d)) ]), |
