mirror of https://github.com/Lissy93/dashy.git
🐛 Fixes (i think) date parsing for Safari users in holidays widget (#1532)
This commit is contained in:
parent
b97ba745a5
commit
72d2f1bb74
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue