Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1fbd90a

Browse files
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
2 parents 4f32ac8 + 7ed03d6 commit 1fbd90a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

‎src/app/organization/holidays/edit-holiday/edit-holiday.component.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,17 @@ export class EditHolidayComponent implements OnInit {
134134
const locale = this.settingsService.language.code;
135135
const dateFormat = this.settingsService.dateFormat;
136136
if (!this.isActiveHoliday) {
137-
if (this.reSchedulingType === 2) {
138-
const repaymentScheduledTo: Date = this.holidayForm.value.repaymentsRescheduledTo;
139-
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(repaymentScheduledTo, dateFormat);
137+
if (holidayFormData.fromDate instanceof Date) {
138+
holidayFormData.fromDate = this.dateUtils.formatDate(holidayFormData.fromDate, dateFormat);
140139
}
141-
const prevFromDate: Date = this.holidayForm.value.fromDate;
142-
const prevToDate: Date = this.holidayForm.value.toDate;
143-
if (holidayFormData.closureDate instanceof Date) {
144-
holidayFormData.fromDate = this.dateUtils.formatDate(prevFromDate, dateFormat);
140+
if (holidayFormData.toDate instanceof Date) {
141+
holidayFormData.toDate = this.dateUtils.formatDate(holidayFormData.toDate, dateFormat);
145142
}
146-
if (holidayFormData.closureDate instanceof Date) {
147-
holidayFormData.toDate = this.dateUtils.formatDate(prevToDate, dateFormat);
143+
if (this.reSchedulingType === 2 && holidayFormData.repaymentsRescheduledTo instanceof Date) {
144+
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(
145+
holidayFormData.repaymentsRescheduledTo,
146+
dateFormat
147+
);
148148
}
149149
}
150150
const data = {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /