Skip to content

Commit

Permalink
fix datetime handling
Browse files Browse the repository at this point in the history
  • Loading branch information
erral committed Jan 18, 2024
1 parent da62b83 commit 7889185
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/euskalmet.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ class Euskalmet extends HTMLElement {
div.className = 'euskalmet-forecast-day';

let dateObject = new Date(item.date);
let dateText = `${dateObject.getFullYear()}-${dateObject.getMonth()}-${dateObject.getDate()}`;
let dateText = dateObject.toLocaleDateString('eu-ES', {
timeZone: 'Europe/Madrid',
});
let shortText = this.shortText ? forecastText : '';

let imageUrl = this.modernImages
Expand Down

0 comments on commit 7889185

Please sign in to comment.