1

I want to translate ionic date-time. That's why I'm using ng2-translate package.

<ion-datetime displayFormat="DDDD MMM D, YYYY" [(ngModel)]="myDate" monthNames="janeiro, fevereiro, march, ..." ></ion-datetime>

here, I'm using monthNames="{{ 'MONTHS' | translate }}" or [monthNames]="'MONTHS' | translate" as translation rules of ng2-translate but its not work just showing an error Cannot read property 'length' of undefined.

If there are any other solution please answer.

Rashed Shaon
  • 348
  • 2
  • 4
  • 17
  • Is `MONTHS` a *variable*? If so, It should be `monthNames="{{ MONTHS | translate }}" or [monthNames]="MONTHS | translate"`. – developer033 Mar 05 '17 at 03:22
  • no translation key which is define in translation .json file {{ 'MONTHS' | translate }} is define as rules.. **'MONTHS'** with single coat quote. – Rashed Shaon Mar 05 '17 at 03:55

0 Answers0