Merge pull request #2753 from JaySoni1/WEB-357-editing-a-holiday-fails-due-to-failure-to-parse-from-date-format

WEB-357 Editing a holiday fails due to failure to parse from date format
This commit is contained in:
Jose Alberto Hernandez
2025-11-04 11:16:09 -05:00
committed by GitHub
@@ -134,17 +134,17 @@ export class EditHolidayComponent implements OnInit {
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
if (!this.isActiveHoliday) {
if (this.reSchedulingType === 2) {
const repaymentScheduledTo: Date = this.holidayForm.value.repaymentsRescheduledTo;
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(repaymentScheduledTo, dateFormat);
if (holidayFormData.fromDate instanceof Date) {
holidayFormData.fromDate = this.dateUtils.formatDate(holidayFormData.fromDate, dateFormat);
}
const prevFromDate: Date = this.holidayForm.value.fromDate;
const prevToDate: Date = this.holidayForm.value.toDate;
if (holidayFormData.closureDate instanceof Date) {
holidayFormData.fromDate = this.dateUtils.formatDate(prevFromDate, dateFormat);
if (holidayFormData.toDate instanceof Date) {
holidayFormData.toDate = this.dateUtils.formatDate(holidayFormData.toDate, dateFormat);
}
if (holidayFormData.closureDate instanceof Date) {
holidayFormData.toDate = this.dateUtils.formatDate(prevToDate, dateFormat);
if (this.reSchedulingType === 2 && holidayFormData.repaymentsRescheduledTo instanceof Date) {
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(
holidayFormData.repaymentsRescheduledTo,
dateFormat
);
}
}
const data = {