I am using Angular 2, trying to convert a date object to HH:mm date format, with minutes to two decimal places, but when I use this:
{{date | date:"HH:mm"}}
I get 15:0 instead of 15:00.
I tried look at Angular 2 documentation but it's relatively limit so far, would appreciate any guidance about this and whether it is how Angular 2 formats time by default.
According to the documentation your usage is correct: https://angular.io/docs/ts/latest/api/common/index/DatePipe-class.html
mm
should result in a 2-digit format.Are you using the most recent version?
The documentation also says Stability: Experimental
. This might still be a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With