Change date format to something sensible

This commit is contained in:
Midgard 2020-05-21 02:02:30 +02:00
parent 855488d227
commit b2c86c9a94
Signed by: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 13 additions and 1 deletions

View file

@ -37,7 +37,7 @@
<img src="img/{{type}}.png" class="type">
<div class="text">Locatie: {{address}}<br />
{{#if period.start}}
Van {{period.start}} tot {{period.end}}
{{date period.start}} tot {{date period.end}}
{{else}}
Open gedurende het hele jaar.
{{/if}}

View file

@ -156,4 +156,16 @@ $(document).ready(function() {
var legend = new SimpleControl("#legend-template", christmasSeason ? "holiday-legend" : "legend", {
position: "bottomright"
}).addTo(map);
var monthNames = ["jan.", "feb.", "mrt.", "apr.", "mei", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec."];
Handlebars.registerHelper("date", function (ddmyyyy) {
var parts = ddmyyyy.split("-");
var date = parts[0];
var month = monthNames[parts[1] - 1];
var year = parts[2];
return date + " " + month + " " + year;
})
});