diff options
| author | Stein Jakob Nordbø | 2012-05-25 14:49:40 +0200 |
|---|---|---|
| committer | Misko Hevery | 2012-09-06 16:06:19 -0700 |
| commit | f299fd512248321b426a5ab924a329aa1b691280 (patch) | |
| tree | c3ca29ccc0c7e2e5ae179d166b2bc048993e3959 /test | |
| parent | 05c88b866bdcd426d09fdb070cc67af718a41557 (diff) | |
| download | angular.js-f299fd512248321b426a5ab924a329aa1b691280.tar.bz2 | |
fix(dateFilter): support sub-second precision on dateFilter
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/filter/filtersSpec.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ng/filter/filtersSpec.js b/test/ng/filter/filtersSpec.js index 55476882..9e0a408a 100644 --- a/test/ng/filter/filtersSpec.js +++ b/test/ng/filter/filtersSpec.js @@ -270,5 +270,18 @@ describe('filters', function() { //no time expect(date('2003-09-10', format)).toEqual('2003-09 00'); }); + + it('should support different degrees of subsecond precision', function () { + var format = 'yyyy-MM-dd'; + + expect(date('2003-09-10T13:02:03.12345678Z', format)).toEqual('2003-09-10'); + expect(date('2003-09-10T13:02:03.1234567Z', format)).toEqual('2003-09-10'); + expect(date('2003-09-10T13:02:03.123456Z', format)).toEqual('2003-09-10'); + expect(date('2003-09-10T13:02:03.12345Z', format)).toEqual('2003-09-10'); + expect(date('2003-09-10T13:02:03.1234Z', format)).toEqual('2003-09-10'); + expect(date('2003-09-10T13:02:03.123Z', format)).toEqual('2003-09-10'); + expect(date('2003-09-10T13:02:03.12Z', format)).toEqual('2003-09-10'); + expect(date('2003-09-10T13:02:03.1Z', format)).toEqual('2003-09-10'); + }); }); }); |
