diff options
| author | Igor Minar | 2010-10-23 18:44:32 -0700 |
|---|---|---|
| committer | Igor Minar | 2010-10-25 10:44:03 -0700 |
| commit | 841013a4c4d25acf6fc9ff40e449c3d0a4b82ec3 (patch) | |
| tree | f01cdcc51efdab4d30566dc838de203317ef5531 /test | |
| parent | 4e9a2aa10ec6e84377aebd37fd3ae44af3d9423a (diff) | |
| download | angular.js-841013a4c4d25acf6fc9ff40e449c3d0a4b82ec3.tar.bz2 | |
Add millisecond support for date filter
Date filter should translate input which is a number (or number
string) into a date.
Diffstat (limited to 'test')
| -rw-r--r-- | test/FiltersSpec.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/FiltersSpec.js b/test/FiltersSpec.js index fbaceac6..6bbc09ae 100644 --- a/test/FiltersSpec.js +++ b/test/FiltersSpec.js @@ -98,12 +98,11 @@ describe('filter', function(){ morning.getTimezoneOffset = noon.getTimezoneOffset = midnight.getTimezoneOffset = - function() { return 7 * 60; }; + function() {return 7 * 60;}; it('should ignore falsy inputs', function() { expect(filter.date(null)).toEqual(null); expect(filter.date('')).toEqual(''); - expect(filter.date(123)).toEqual(123); }); it('should do basic filter', function() { @@ -111,6 +110,11 @@ describe('filter', function(){ expect(filter.date(noon, '')).toEqual(noon.toLocaleDateString()); }); + it('should accept number or number string representing milliseconds as input', function() { + expect(filter.date(noon.getTime())).toEqual(noon.toLocaleDateString()); + expect(filter.date(noon.getTime() + "")).toEqual(noon.toLocaleDateString()); + }); + it('should accept format', function() { expect(filter.date(midnight, "yyyy-M-d h=H:m:saZ")). toEqual('2010-9-3 12=0:5:8am0700'); @@ -122,8 +126,6 @@ describe('filter', function(){ toEqual('2010-09-03 12=12:05:08pm0700'); }); - - }); }); |
