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:
@@ -134,17 +134,17 @@ export class EditHolidayComponent implements OnInit {
|
|||||||
const locale = this.settingsService.language.code;
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = this.settingsService.dateFormat;
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
if (!this.isActiveHoliday) {
|
if (!this.isActiveHoliday) {
|
||||||
if (this.reSchedulingType === 2) {
|
if (holidayFormData.fromDate instanceof Date) {
|
||||||
const repaymentScheduledTo: Date = this.holidayForm.value.repaymentsRescheduledTo;
|
holidayFormData.fromDate = this.dateUtils.formatDate(holidayFormData.fromDate, dateFormat);
|
||||||
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(repaymentScheduledTo, dateFormat);
|
|
||||||
}
|
}
|
||||||
const prevFromDate: Date = this.holidayForm.value.fromDate;
|
if (holidayFormData.toDate instanceof Date) {
|
||||||
const prevToDate: Date = this.holidayForm.value.toDate;
|
holidayFormData.toDate = this.dateUtils.formatDate(holidayFormData.toDate, dateFormat);
|
||||||
if (holidayFormData.closureDate instanceof Date) {
|
|
||||||
holidayFormData.fromDate = this.dateUtils.formatDate(prevFromDate, dateFormat);
|
|
||||||
}
|
}
|
||||||
if (holidayFormData.closureDate instanceof Date) {
|
if (this.reSchedulingType === 2 && holidayFormData.repaymentsRescheduledTo instanceof Date) {
|
||||||
holidayFormData.toDate = this.dateUtils.formatDate(prevToDate, dateFormat);
|
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(
|
||||||
|
holidayFormData.repaymentsRescheduledTo,
|
||||||
|
dateFormat
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const data = {
|
const data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user