fix availability ui bug

This commit is contained in:
Dobromir Popov
2024-04-01 13:05:35 +03:00
parent f488fa971a
commit 5a658d4e19
3 changed files with 49 additions and 23 deletions

View File

@ -165,7 +165,6 @@ export default function AvailabilityForm({ publisherId, existingItem, inline, on
e.preventDefault();
try {
if (!availability.name) {
// availability.name = "От календара";
availability.name = common.getTimeFomatted(availability.startTime) + "-" + common.getTimeFomatted(availability.endTime);
@ -174,12 +173,13 @@ export default function AvailabilityForm({ publisherId, existingItem, inline, on
availability.dayofweek = common.getDayOfWeekNameEnEnum(availability.startTime);
if (availability.repeatWeekly) {
availability.dayOfMonth = null;
availability.weekOfMonth = 0; //weekly recurrance - no need for week of month. special value 0
} else {
availability.endDate = null;
availability.dayOfMonth = availability.startTime.getDate();
}
delete availability.date; //remove date from availability as it is not part of the db model
delete availability.date; //remove date from availability as it is not part of the db model. we store the info in startDate and endDate
// ---------------------- CB UI --------------
if (config.checkboxUI.enabled) {
const selectedSlots = timeSlots.filter(slot => slot.isChecked);