diff --git a/src/index.html b/src/index.html index 1c5a290..1e9ae35 100644 --- a/src/index.html +++ b/src/index.html @@ -37,7 +37,7 @@
Locatie: {{address}}
{{#if period.start}} - Van {{period.start}} tot {{period.end}} + {{date period.start}} tot {{date period.end}} {{else}} Open gedurende het hele jaar. {{/if}} diff --git a/src/js/map.js b/src/js/map.js index 973ce30..2b3f762 100644 --- a/src/js/map.js +++ b/src/js/map.js @@ -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; + }) });