Skip to content

Commit

Permalink
馃攢 Merge pull request #1577 from Lissy93/FIX/holiday-widget
Browse files Browse the repository at this point in the history
[FIX] Date parsing on Safari for the Public Holidays widget
Fixes  #1532
  • Loading branch information
Lissy93 committed May 10, 2024
2 parents b97ba74 + 72d2f1b commit eea193a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/Widgets/PublicHolidays.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ export default {
/* Assign data variables to the returned data */
processData(holidays) {
const results = [];
const makeDate = (date) => timestampToDate(
new Date(`${date.year}-${date.month}-${date.day}`).getTime(),
);
const makeDate = (date) => {
const formattedMonth = date.month.toString().padStart(2, '0'); // Ensure two digits
const formattedDay = date.day.toString().padStart(2, '0'); // Ensure two digits
const dateString = `${date.year}-${formattedMonth}-${formattedDay}T00:00:00`;
return timestampToDate(new Date(dateString).getTime());
};
const formatType = (ht) => capitalize(ht.replaceAll('_', ' '));
holidays.forEach((holiday) => {
results.push({
Expand Down

0 comments on commit eea193a

Please sign in to comment.