Skip to content

Commit

Permalink
Merge pull request #1300 from culturecreates/bugfix/issue-84
Browse files Browse the repository at this point in the history
Bugfix/issue 84
  • Loading branch information
AbhishekPAnil authored Sep 20, 2024
2 parents f0bcd3c + a775108 commit a05fee9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/components/RecurringEvents/recurringEvents.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@
color: #222732;
}

.recurring-modal .calendar .calendar-header .year-neighbor {
display: none !important;
}
.recurring-modal .calendar .calendar-header .year-neighbor2 {
display: none !important;
}

@media screen and (max-width: 480px) {
.custom-date-column {
height: 200px;
Expand Down
45 changes: 40 additions & 5 deletions src/pages/Dashboard/AddEvent/AddEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2585,12 +2585,47 @@ function AddEvent() {
promptText={type.tooltip}
secondaryIcon={<InfoCircleOutlined />}
onClick={() => {
let currentActiveDateValue;
let activeDateType = type.type;
if (dateType === dateTypes.SINGLE) {
const datePickerValue = form.getFieldValue('datePicker');
currentActiveDateValue = datePickerValue ? [datePickerValue, undefined] : undefined;
} else if (dateType === dateTypes.RANGE) {
setStartDate(undefined);
setEndDate(undefined);
currentActiveDateValue = form.getFieldValue('dateRangePicker') ?? undefined;
} else if (dateType === dateTypes.MULTIPLE) {
setStartDate(undefined);
setEndDate(undefined);
currentActiveDateValue = form.getFieldValue('startDateRecur') ?? undefined;
}
setDateType(type.type);
form.setFieldsValue({
datePicker: undefined,
dateRangePicker: undefined,
startDateRecur: undefined,
});

if (currentActiveDateValue) {
if (activeDateType === dateTypes.SINGLE) {
form.setFieldValue(
'datePicker',
Array.isArray(currentActiveDateValue) ? currentActiveDateValue[0] : undefined,
);
form.setFieldsValue({
dateRangePicker: undefined,
startDateRecur: undefined,
});
} else if (activeDateType === dateTypes.RANGE) {
form.setFieldValue('dateRangePicker', currentActiveDateValue);
form.setFieldsValue({
datePicker: undefined,
startDateRecur: undefined,
});
} else if (activeDateType === dateTypes.MULTIPLE) {
form.setFieldValue('startDateRecur', currentActiveDateValue);
form.setFieldsValue({
datePicker: undefined,
dateRangePicker: undefined,
});
}
}

form.resetFields(['frequency']);
setFormValue(null);
}}
Expand Down

0 comments on commit a05fee9

Please sign in to comment.