Initial commit, frontend with PreactJS and hash routing, backend with PolkaJS

This commit is contained in:
2022-10-31 02:13:07 +01:00
commit 6c877eccf0
17 changed files with 1687 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
export function toLocalISO(date) {
var tzo = -date.getTimezoneOffset(),
dif = tzo >= 0 ? '+' : '-',
pad = function (num) {
return (num < 10 ? '0' : '') + num
}
return (
date.getFullYear() +
'-' +
pad(date.getMonth() + 1) +
'-' +
pad(date.getDate()) +
'T' +
pad(date.getHours()) +
':' +
pad(date.getMinutes()) +
':' +
pad(date.getSeconds()) +
dif +
pad(Math.floor(Math.abs(tzo) / 60)) +
':' +
pad(Math.abs(tzo) % 60)
)
}