Skip to content

Commit

Permalink
Merge pull request #308 from MadhuMosip/develop
Browse files Browse the repository at this point in the history
MOSIP-16525 changing calendar language dynamically
  • Loading branch information
aranaravi authored Mar 22, 2024
2 parents 0a056b6 + 9b60157 commit 68a912e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
matSuffix
[for]="picker"
></mat-datepicker-toggle>
<mat-datepicker [disabled]="!isEditable && id" #picker></mat-datepicker>
<mat-datepicker (opened)="changeCalendarLang(primaryLangCode)" [disabled]="!isEditable && id" #picker></mat-datepicker>
</mat-form-field>

<div *ngIf="field.showInSingleView === 'true' && field.inputType === 'dropdown' && field.name === 'locationCode'">
Expand Down Expand Up @@ -626,7 +626,7 @@
[for]="picker1"
[disabled]="!isEditable && id"
></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker>
<mat-datepicker (opened)="changeCalendarLang(secondaryLang)" #picker1></mat-datepicker>
</mat-form-field>

<div *ngIf="field.showInSingleView === 'true' && field.inputType === 'dropdown' && field.name === 'locationCode'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export class MaterDataCommonBodyComponent implements OnInit {
this.url = this.router.url.split('/')[3];
this.fieldsCount = 0;
this.primaryLangCode = this.headerService.getUserPreferredLanguage();
this.dateAdapter.setLocale(defaultJson.keyboardMapping[this.primaryLangCode]);
if(this.primaryLang === "ara"){
this.isPrimaryLangRTL = true;
}
Expand Down Expand Up @@ -299,6 +298,10 @@ export class MaterDataCommonBodyComponent implements OnInit {

}

changeCalendarLang(lang:string){
this.dateAdapter.setLocale(defaultJson.keyboardMapping[lang]);
}

@HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) {
if (this.keyboardService.isOpened) {
this.keyboardService.dismiss();
Expand Down

0 comments on commit 68a912e

Please sign in to comment.