Revert "Finished first day in week config"

This reverts commit 14e9ce5aba.
This commit is contained in:
shamoon 2023-09-28 11:22:51 -07:00
parent 14e9ce5aba
commit f58f430a2b
2 changed files with 4 additions and 6 deletions

View File

@ -358,7 +358,6 @@ export function cleanServiceGroups(groups) {
mappings, // customapi widget mappings, // customapi widget
refreshInterval, refreshInterval,
integrations, // calendar widget integrations, // calendar widget
firstDayInWeek,
} = cleanedService.widget; } = cleanedService.widget;
let fieldsList = fields; let fieldsList = fields;
@ -444,7 +443,6 @@ export function cleanServiceGroups(groups) {
} }
if (type === "calendar") { if (type === "calendar") {
if (integrations) cleanedService.widget.integrations = integrations; if (integrations) cleanedService.widget.integrations = integrations;
if (firstDayInWeek) cleanedService.widget.firstDayInWeek = firstDayInWeek;
} }
} }

View File

@ -98,13 +98,13 @@ export default function MonthlyView({ service }) {
const dayNames = Info.weekdays("short", { locale: i18n.language }); const dayNames = Info.weekdays("short", { locale: i18n.language });
const firstDayInWeekCalendar = widget?.firstDayInWeek ? widget?.firstDayInWeek?.toLowerCase() : "monday"; const firstDayInCalendar = widget?.firstDayInCalendar ? widget?.firstDayInCalendar?.toLowerCase() : "monday";
for (let i = 1; i < dayInWeekId[firstDayInWeekCalendar]; i+=1) { for (let i = 1; i < dayInWeekId[firstDayInCalendar]; i+=1) {
dayNames.push(dayNames.shift()); dayNames.push(dayNames.shift());
} }
const daysInWeek = useMemo(() => [ ...Array(7).keys() ].map( i => i + dayInWeekId[firstDayInWeekCalendar] const daysInWeek = useMemo(() => [ ...Array(7).keys() ].map( i => i + dayInWeekId[firstDayInCalendar]
), [(firstDayInWeekCalendar)]); ), [(firstDayInCalendar)]);
if (!showDate) { if (!showDate) {
return <div className="w-full text-center" />; return <div className="w-full text-center" />;