diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-08-25 12:22:30 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-08-25 12:22:30 +0200 |
commit | 9b5e1892c656f71c5cd470523a653ed385ac3d93 (patch) | |
tree | 83d6621bfb338e602a6f05bf2731aa1545879b26 | |
parent | 6c52ccbe01f40212244864de09fa399b1ed080ec (diff) | |
download | ramaskrik-social-9b5e1892c656f71c5cd470523a653ed385ac3d93.tar.gz ramaskrik-social-9b5e1892c656f71c5cd470523a653ed385ac3d93.tar.bz2 ramaskrik-social-9b5e1892c656f71c5cd470523a653ed385ac3d93.zip |
app.js: Capitalize date in heading above schedules.
-rw-r--r-- | public/js/app.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/public/js/app.js b/public/js/app.js index 309625f..2cb5df7 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -37,6 +37,10 @@ function date_f(d) { return new Intl.DateTimeFormat('nb-NO', opts).format(d) } +function capitalize(s) { + return s.slice(0, 1).toUpperCase() + s.slice(1) +} + function isodate(d) { return d.getFullYear() + "-" + pad(d.getMonth() + 1) + "-" + pad(d.getDate()) } @@ -183,7 +187,7 @@ window.addEventListener("load", function() { console.log("dateobj: " + dateobj) day.id = "program-" + isodate(dateobj) - day.innerHTML = '<h2>' + date_f(dateobj) + '</h2>' + day.innerHTML = '<h2>' + capitalize(date_f(dateobj)) + '</h2>' + '<canvas id="canvas-' + isodate(dateobj) + '" height="' + canvas_height * 2 + '" width="' + width * 2 + '">' + '</canvas>' p.appendChild(day) |