Spread parameter on setter
This commit is contained in:
parent
6bcd4812a3
commit
cc973b4ead
@ -12,6 +12,9 @@ function daysDifference(date1: Date, date2: Date) {
|
|||||||
date2 = date1;
|
date2 = date1;
|
||||||
date1 = tmp;
|
date1 = tmp;
|
||||||
}
|
}
|
||||||
|
console.log("Diff")
|
||||||
|
console.log(date1)
|
||||||
|
console.log(date2)
|
||||||
return Math.ceil((date2.getTime() - date1.getTime()) / 1000 / 60 / 60 / 24);
|
return Math.ceil((date2.getTime() - date1.getTime()) / 1000 / 60 / 60 / 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +86,7 @@ const Calendar = ({ secrets }: { secrets: SecretsCalendar }) => {
|
|||||||
|
|
||||||
const timeMin = new Date();
|
const timeMin = new Date();
|
||||||
timeMin.setHours(timeMin.getHours() - 1);
|
timeMin.setHours(timeMin.getHours() - 1);
|
||||||
|
console.log(timeMin);
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
orderBy: "startTime",
|
orderBy: "startTime",
|
||||||
fields: "items(creator,start,summary)",
|
fields: "items(creator,start,summary)",
|
||||||
@ -96,7 +100,7 @@ const Calendar = ({ secrets }: { secrets: SecretsCalendar }) => {
|
|||||||
headers: { Authorization: `Bearer ${correctToken}` }
|
headers: { Authorization: `Bearer ${correctToken}` }
|
||||||
});
|
});
|
||||||
const events = await response.json();
|
const events = await response.json();
|
||||||
setEvents(processEventData(events.items));
|
setEvents([...processEventData(events.items)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
@ -29,7 +29,7 @@ const DVB = ({ stopId }: { stopId: number }) => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
setDeparturesTable(depTable);
|
setDeparturesTable([...depTable]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pullDepartures = async () => {
|
const pullDepartures = async () => {
|
||||||
|
@ -36,7 +36,7 @@ const News = () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
setNews(newsTable);
|
setNews([...newsTable]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pullNews = async () => {
|
const pullNews = async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user