Finished first day in week config
Signed-off-by: Denis Papec <denis.papec@gmail.com>
This commit is contained in:
parent
97dd781aca
commit
14e9ce5aba
@ -358,6 +358,7 @@ 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;
|
||||||
@ -443,6 +444,7 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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 firstDayInCalendar = widget?.firstDayInCalendar ? widget?.firstDayInCalendar?.toLowerCase() : "monday";
|
const firstDayInWeekCalendar = widget?.firstDayInWeek ? widget?.firstDayInWeek?.toLowerCase() : "monday";
|
||||||
for (let i = 1; i < dayInWeekId[firstDayInCalendar]; i+=1) {
|
for (let i = 1; i < dayInWeekId[firstDayInWeekCalendar]; i+=1) {
|
||||||
dayNames.push(dayNames.shift());
|
dayNames.push(dayNames.shift());
|
||||||
}
|
}
|
||||||
|
|
||||||
const daysInWeek = useMemo(() => [ ...Array(7).keys() ].map( i => i + dayInWeekId[firstDayInCalendar]
|
const daysInWeek = useMemo(() => [ ...Array(7).keys() ].map( i => i + dayInWeekId[firstDayInWeekCalendar]
|
||||||
), [(firstDayInCalendar)]);
|
), [(firstDayInWeekCalendar)]);
|
||||||
|
|
||||||
if (!showDate) {
|
if (!showDate) {
|
||||||
return <div className="w-full text-center" />;
|
return <div className="w-full text-center" />;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user