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
145
Use locale and formatter in igx-date-picker
posted

Hello,

in our app we use a grid with editable timestamp values in some cells. So far i didn't found any date&time picker... Thats why we are going to use 1 date and 1 time picker for the same field (the implementation works fine :-)). But I also need to set the locale of the igx-date-picker and the date format can be customized, too.

Whenever I used the locale (as described here https://www.infragistics.com/products/ignite-ui-angular/angular/components/date-picker#internationalization) , the [formatter] or [format] will fail, when I f.e. select a 31. March. Suddently i can see NAN... With locale it works as expected.

Is there any way to get the calendar translations for a the specific language + using a specific date format?


Our current code looks more or less like this:

            <igx-date-picker [(ngModel)]="manualDate" [formatter]="dateFormatter"
                             [mask]="dateFormat" [ngModelOptions]="{standalone: true}"
                             [showWeekNumbers]="true"
                             cancelButtonLabel="{{ 'CANCEL' | translate }}"mode="dropdown"
                             todayButtonLabel="{{ 'TODAY' | translate }}">
              <ng-template igxDatePickerTemplate
                           let-displayData="displayData"
                           let-openDialog="openDialog">
                <igx-input-group>
                  <input #dateDropDownTarget (blur)="onManualDateChange($event.target.value, cell)" [value]="displayData" igxInput/>
                  <igx-suffix (click)="openDialog(dateDropDownTarget)">
                    <igx-icon>event_note</igx-icon>
                  </igx-suffix>
                </igx-input-group>
              </ng-template>
            </igx-date-picker>



We use the  version "10.2.10".