redesign calendar api for improving loading performance
This commit is contained in:
parent
78d542cbac
commit
d2b2cea846
5 changed files with 76 additions and 99 deletions
|
|
@ -12,7 +12,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.calendar-strip__days.progress {
|
||||
/* .calendar-strip__days.progress {
|
||||
cursor: progress !important;
|
||||
}
|
||||
.calendar-strip__days.progress > li {
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
.calendar-strip__days.progress button {
|
||||
cursor: progress !important;
|
||||
}
|
||||
} */
|
||||
|
||||
.grid {
|
||||
--column-gap: calc(var(--space-m) * 1.1);
|
||||
|
|
|
|||
|
|
@ -149,18 +149,14 @@ function getId(eventData) {
|
|||
function createEmptyCalendar() {
|
||||
const calendar = {};
|
||||
|
||||
for (let month = 9; month < 19; month++) {
|
||||
for (let month = 9; month < 21; month++) {
|
||||
const normalizedMonth = ((month - 1) % 12) + 1;
|
||||
|
||||
const daysInMonth = dayjs()
|
||||
.month(normalizedMonth - 1)
|
||||
.daysInMonth();
|
||||
|
||||
calendar[normalizedMonth] = {
|
||||
name: dayjs()
|
||||
.month(normalizedMonth - 1)
|
||||
.format("MMMM"),
|
||||
};
|
||||
calendar[normalizedMonth] = {};
|
||||
|
||||
for (let day = 1; day <= daysInMonth; day++) {
|
||||
calendar[normalizedMonth][day] = null;
|
||||
|
|
@ -170,7 +166,7 @@ function createEmptyCalendar() {
|
|||
return calendar;
|
||||
}
|
||||
|
||||
async function getMergedDates(monthNumb, dates) {
|
||||
async function getCurrentSeasonCalendar(monthNumb, dates) {
|
||||
const calendar = createEmptyCalendar();
|
||||
|
||||
const requestParams = {
|
||||
|
|
@ -187,7 +183,6 @@ async function getMergedDates(monthNumb, dates) {
|
|||
requestOptions
|
||||
);
|
||||
const json = await response.json();
|
||||
console.log("calendar", json);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue