Skip to content

Commit 72c2115

Browse files
committed
Correct event marker date display affected by timezone (#6)
1 parent 74d3961 commit 72c2115

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

themes/django20/static/js/events_map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function renderEvents(geojsonData) {
4545
},
4646
onEachFeature: (feature, layer) => {
4747
const props = feature.properties;
48-
const eventDate = new Date(props.date);
48+
const eventDate = new Date(props.date + "T00:00:00Z");
4949
let eventDateEnd = null;
5050
if (props.end_date) {
5151
eventDateEnd = new Date(props.end_date);
@@ -56,13 +56,15 @@ function renderEvents(geojsonData) {
5656
year: "numeric",
5757
month: "long",
5858
day: "numeric",
59+
timeZone: "UTC",
5960
});
6061
if (eventDateEnd) {
6162
formattedDate += "-" + eventDateEnd.toLocaleDateString("en-US", {
6263
weekday: "long",
6364
year: "numeric",
6465
month: "long",
6566
day: "numeric",
67+
timeZone: "UTC",
6668
});
6769
}
6870

0 commit comments

Comments
 (0)