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 */
|
/* Assign data variables to the returned data */
|
||||||
processData(holidays) {
|
processData(holidays) {
|
||||||
const results = [];
|
const results = [];
|
||||||
const makeDate = (date) => timestampToDate(
|
const makeDate = (date) => {
|
||||||
new Date(`${date.year}-${date.month}-${date.day}`).getTime(),
|
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('_', ' '));
|
const formatType = (ht) => capitalize(ht.replaceAll('_', ' '));
|
||||||
holidays.forEach((holiday) => {
|
holidays.forEach((holiday) => {
|
||||||
results.push({
|
results.push({
|
||||||
|
|
Loading…
Reference in New Issue