From 9b5e1892c656f71c5cd470523a653ed385ac3d93 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 25 Aug 2020 12:22:30 +0200 Subject: app.js: Capitalize date in heading above schedules. --- public/js/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = '

' + date_f(dateobj) + '

' + day.innerHTML = '

' + capitalize(date_f(dateobj)) + '

' + '' + '' p.appendChild(day) -- cgit v1.2.3