Skip to content

Commit

Permalink
Fixed #10503 - dateFormat option for I18N API
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Aug 13, 2021
1 parent 151680e commit aee2f83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/components/api/primengconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class PrimeNGConfig {
dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"],
monthNames: ["January","February","March","April","May","June","July","August","September","October","November","December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
dateFormat: 'mm/dd/yy',
today: 'Today',
weekHeader: 'Wk',
weak: 'Weak',
Expand Down
1 change: 1 addition & 0 deletions src/app/components/api/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface Translation {
dayNamesMin?: string[];
monthNames?: string[];
monthNamesShort?: string[];
dateFormat?: string;
today?: string;
weekHeader?: string;
weak?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {

@Input() disabled: any;

@Input() dateFormat: string = 'mm/dd/yy';
@Input() dateFormat: string;

@Input() multipleSeparator: string = ',';

Expand Down Expand Up @@ -2168,7 +2168,7 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {
}

getDateFormat() {
return this.dateFormat;
return this.dateFormat||this.getTranslation('dateFormat');
}

// Ported from jquery-ui datepicker formatDate
Expand Down

0 comments on commit aee2f83

Please sign in to comment.