Skip to content

Commit

Permalink
fix(date-picker): fix YYYY-MM-dd formatting (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelez committed Oct 20, 2023
1 parent eaaefc9 commit f641ccb
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -236,7 +236,7 @@ export class AppDatePickerComponent
this.month = dateValue.month ? dateValue.month : 0;
this.year = dateValue.year;
this.emitDateChanged.emit(
this.transform(dateValue, 'YYYY-dd-MM', 'gravsearch')
this.transform(dateValue, 'YYYY-MM-dd', 'gravsearch')
);
} else {
this.dateForm.setValue({ date: null, knoraDate: null });
Expand Down Expand Up @@ -389,13 +389,13 @@ export class AppDatePickerComponent
} else {
return `${date.year}`;
}
case 'YYYY-dd-MM':
case 'YYYY-MM-dd':
if (date.precision === 2) {
return `${date.year}-${this.leftPadding(
date.month
)}-${this.leftPadding(date.day)}`;
} else if (date.precision === 1) {
return `${this.leftPadding(date.month)}-${date.year}`;
return `${date.year}-${this.leftPadding(date.month)}`;
} else {
return `${date.year}`;
}
Expand Down

0 comments on commit f641ccb

Please sign in to comment.