From @otaran on May 22, 2017 19:39
Steps to reproduce
- Create date with
hours < 10 and seconds < 10.
- Display this date with
date pipe and medium format:
@Component({
template: `<Label [text]="now | date:'medium'"></Label>
})
export class DateComponent {
now = Date.parse('2017-05-22T07:05:09Z');
}
Expected result
The date doesn't have leading zero in hours, has leading zero in seconds and has a comma after year: May 22, 2017, 7:05:09 AM (in UTC timezone).
Actual result
The date has leading zero in hours, doesn't have leading zero in seconds and doesn't have a comma after year: May 22, 2017 07:05:9 AM (in UTC timezone).
Notes
Plunker to demonstrate expected Angular behavior: https://embed.plnkr.co/eF8VFN/
Nativescript app to demonstrate actual behavior: tns-date-pipe.zip
Copied from original issue: NativeScript/nativescript-angular#815