Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,14 @@ export class CreateHolidayComponent implements OnInit {
const locale = this.settings.language.code;
const prevFromDate: Date = this.holidayForm.value.fromDate;
const prevToDate: Date = this.holidayForm.value.toDate;
holidayFormData.fromDate = this.dateUtils.formatDate(prevFromDate, dateFormat);
holidayFormData.toDate = this.dateUtils.formatDate(prevToDate, dateFormat);
holidayFormData.fromDate = this.dateUtils.formatDateAsString(prevFromDate, dateFormat);
holidayFormData.toDate = this.dateUtils.formatDateAsString(prevToDate, dateFormat);
if (this.holidayForm.contains('repaymentsRescheduledTo')) {
const prevRepaymentsRescheduledTo: Date = this.holidayForm.value.repaymentsRescheduledTo;
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(prevRepaymentsRescheduledTo, dateFormat);
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDateAsString(
prevRepaymentsRescheduledTo,
dateFormat
);
}
const offices = this.holidayForm.value.offices.map((office: string) => {
return { officeId: Number.parseInt(office, 10) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,20 @@ export class EditHolidayComponent implements OnInit {
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
if (!this.isActiveHoliday) {
if (holidayFormData.fromDate instanceof Date) {
holidayFormData.fromDate = this.dateUtils.formatDate(holidayFormData.fromDate, dateFormat);
const prevFromDate = this.holidayForm.value.fromDate;
const prevToDate = this.holidayForm.value.toDate;

if (prevFromDate instanceof Date) {
holidayFormData.fromDate = this.dateUtils.formatDateAsString(prevFromDate, dateFormat);
}
if (holidayFormData.toDate instanceof Date) {
holidayFormData.toDate = this.dateUtils.formatDate(holidayFormData.toDate, dateFormat);
if (prevToDate instanceof Date) {
holidayFormData.toDate = this.dateUtils.formatDateAsString(prevToDate, dateFormat);
}
if (this.reSchedulingType === 2 && holidayFormData.repaymentsRescheduledTo instanceof Date) {
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(
holidayFormData.repaymentsRescheduledTo,
dateFormat
);
if (this.reSchedulingType === 2) {
const repaymentScheduledTo = this.holidayForm.value.repaymentsRescheduledTo;
if (repaymentScheduledTo instanceof Date) {
holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDateAsString(repaymentScheduledTo, dateFormat);
}
}
}
const data = {
Expand Down