diff --git a/modules/@angular/common/src/pipes/date_pipe.ts b/modules/@angular/common/src/pipes/date_pipe.ts index bac0f10875..68bf023591 100644 --- a/modules/@angular/common/src/pipes/date_pipe.ts +++ b/modules/@angular/common/src/pipes/date_pipe.ts @@ -104,7 +104,7 @@ export class DatePipe implements PipeTransform { } if (NumberWrapper.isNumeric(value)) { - value = DateWrapper.fromMillis(NumberWrapper.parseInt(value, 10)); + value = DateWrapper.fromMillis(parseFloat(value)); } else if (isString(value)) { value = DateWrapper.fromISOString(value); } diff --git a/modules/@angular/common/test/pipes/date_pipe_spec.ts b/modules/@angular/common/test/pipes/date_pipe_spec.ts index dd9e889eae..e45dede9ae 100644 --- a/modules/@angular/common/test/pipes/date_pipe_spec.ts +++ b/modules/@angular/common/test/pipes/date_pipe_spec.ts @@ -36,6 +36,9 @@ export function main() { it('should support numeric strings', () => { expect(() => pipe.transform('123456789')).not.toThrow(); }); + it('should support decimal strings', + () => { expect(() => pipe.transform('123456789.11')).not.toThrow(); }); + it('should support ISO string', () => { expect(() => pipe.transform('2015-06-15T21:43:11Z')).not.toThrow(); });