Hi,
I have a date field which will show correct value when in 'en' but if the language is changed to 'zh-Hans' or 'pl' and few more languages on the portal, it is showing 'invalid date' with the following error on browser console. I have also noticed for language 'danish' its showing 'Feb 19, 1984' instead of 'Feb 14, 1984' in english. This is an issue blocking us from going Live. Please let me know if you need any further details.
main.b0db31c71107ecc133f7.js:1 ERROR Error: InvalidPipeArgument: 'Unable to convert "Invalid Date" into a date' for pipe 'e'
at $e (main.b0db31c71107ecc133f7.js:1)
at e.transform (main.b0db31c71107ecc133f7.js:1)
at main.b0db31c71107ecc133f7.js:1
at main.b0db31c71107ecc133f7.js:1
at Cm (main.b0db31c71107ecc133f7.js:1)
at oz (main.b0db31c71107ecc133f7.js:1)
at Object.updateDirectives (6.6b9e29a544a39c1d7d2e.js:1)
at Object.updateDirectives (main.b0db31c71107ecc133f7.js:1)
at Tm (main.b0db31c71107ecc133f7.js:1)
at Im (main.b0db31c71107ecc133f7.js:1)
7 Answer(s)
-
0
-
0
Hi ,
The issue happens when we are trying to display a date on bootstrap date picker in the above languages and using a date pipe. On this demo site , I could not see any place where there is a datepicker displaying date.
<input type="text" class="form-control" placeholder="{{ l('DOB') }}" autocomplete="off" bsDatepicker [ngModel]="demoDetails.dob | date" [bsConfig]="{ adaptivePosition: true, dateInputFormat: 'MMM D, YYYY' }" (bsValueChange)= "demoDetails.dob = $event" name="dob" [ngClass]="{ 'is-invalid': myForm.hasError('required','dob')}" formControlName="dob" />
-
0
Hi ,
Looks like the issue only exists for Bootstrap date picker while displaying a date field like above.
when displaying the same date with pipe on a td element , displays the correct date. Let me know if you need any further information.
-
0
Hi @MellowoodMedical
Can you please check if adding datePickerMomentModifier to your datepicker solves your problem.
check that: demo-ui-date-time.component.html
If your version of ASP.Net Zero does not contains datePickerMomentModifier you can add it manually. Check: date-picker-moment-modifier.directive.ts
-
0
Hi ,
I have implemented the datePickerMomentModifier but no luck. This to convert every date as moment but the actual issue here is when using date pipe with different locale like 'zh-Hans' or 'swedish' on bootstrap date picker.
-
0
Hi @MellowoodMedical
Have you solved this issue ?
-
0
This issue is closed because it has not had recent activity for a long time.