Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
How to set locale for igx-timepicker?
posted

We are using generic timepicker columns in our grid, but we cannot figure out how to set the locale for these to show the time information in German, for example.

Here is our template:

            <ng-template igxCellEditor let-val let-cell="cell">
                <igx-time-picker mode="dropdown" [(ngModel)]="cell.editValue">
                    <ng-template igxTimePickerTemplate let-openDialog="openDialog">
                        <igx-input-group type="box" [displayDensity]="'compact'">
                            <igx-prefix>
                                <igx-icon (click)="openDialog(timeInput)">access_time</igx-icon>
                            </igx-prefix>
                            <input #timeInput
                                   igxInput
                                   [igxFocus]="true"
                                   [igxDateTimeEditor]="timeMask"
                                   [locale]="getLocale()"
                                   [igxTextSelection]="true"
                                   [placeholder]="timePlaceholder"
                                   (keydown)="onDateEditorKeyDown($event, cell, this)"
                                   autocomplete="off"
                                   tabindex="0"
                                   [(ngModel)]="cell.editValue" />
                        </igx-input-group>
                    </ng-template>
                </igx-time-picker>
            </ng-template>