Linked the sticker seeder to the calender context.

This commit is contained in:
Lucid Kobold
2022-01-03 14:19:31 -06:00
parent 454ef47837
commit 27a6f630ba

View File

@@ -87,9 +87,6 @@ const CalenderContextProvider = ({
const endLastMonth = getDate(endOfMonth(sub(selectedDate, { months: 1 }))); const endLastMonth = getDate(endOfMonth(sub(selectedDate, { months: 1 })));
const startOfSelectedMonth = format(startOfMonth(selectedDate), "iii"); const startOfSelectedMonth = format(startOfMonth(selectedDate), "iii");
// console.log(stickersMonth);
console.log(stickersSeeder());
const ISOToIndex = { const ISOToIndex = {
sunday: { sunday: {
Sun: 0, Sun: 0,
@@ -132,11 +129,14 @@ const CalenderContextProvider = ({
thisWeek.forEach((e, i) => { thisWeek.forEach((e, i) => {
const overflowInfo = isOverflow(selectedDate, sunCurrDate); const overflowInfo = isOverflow(selectedDate, sunCurrDate);
const stickerDay = overflowInfo.isOverflow
? null
: stickersMonth[getDate(sunCurrDate)];
const day: MonthDay = { const day: MonthDay = {
...overflowInfo, ...overflowInfo,
date: sunCurrDate, date: sunCurrDate,
// sticker: stickersMonth[getDate(sunCurrDate)].sticker sticker: stickerDay ? stickerDay.sticker : null
}; };
sunCurrDate = add(sunCurrDate, { sunCurrDate = add(sunCurrDate, {
@@ -166,12 +166,15 @@ const CalenderContextProvider = ({
const thisWeek = mondays[week]; const thisWeek = mondays[week];
thisWeek.forEach((e, i) => { thisWeek.forEach((e, i) => {
const overflowInfo = isOverflow(selectedDate, sunCurrDate); const overflowInfo = isOverflow(selectedDate, monCurrDate);
const stickerDay = overflowInfo.isOverflow
? null
: stickersMonth[getDate(monCurrDate)];
const day: MonthDay = { const day: MonthDay = {
...overflowInfo, ...overflowInfo,
date: monCurrDate, date: monCurrDate,
// sticker: stickersMonth[getDate(monCurrDate)].sticker sticker: stickerDay ? stickerDay.sticker : null
}; };
monCurrDate = add(monCurrDate, { monCurrDate = add(monCurrDate, {