aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng
diff options
context:
space:
mode:
authorMaxim Grach2013-02-01 11:41:28 +0600
committerIgor Minar2013-02-07 02:28:33 -0800
commitdf744f3af46fc227a934f16cb63c7a6038e7133b (patch)
tree01ffb1ec1048745c2dbb5f8f66f2c1c5326232ff /test/ng
parent8155c3a29ea0eb14806913b8ac08ba7727e1969c (diff)
downloadangular.js-df744f3af46fc227a934f16cb63c7a6038e7133b.tar.bz2
feat(dateFilter): add `[.,]sss` formatter for milliseconds
Also Implement getMilliseconds() method of TzDate and add test for this in ngMock.
Diffstat (limited to 'test/ng')
-rw-r--r--test/ng/filter/filtersSpec.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/ng/filter/filtersSpec.js b/test/ng/filter/filtersSpec.js
index 2bc709ee..766df989 100644
--- a/test/ng/filter/filtersSpec.js
+++ b/test/ng/filter/filtersSpec.js
@@ -162,9 +162,9 @@ describe('filters', function() {
describe('date', function() {
- var morning = new angular.mock.TzDate(+5, '2010-09-03T12:05:08.000Z'); //7am
- var noon = new angular.mock.TzDate(+5, '2010-09-03T17:05:08.000Z'); //12pm
- var midnight = new angular.mock.TzDate(+5, '2010-09-03T05:05:08.000Z'); //12am
+ var morning = new angular.mock.TzDate(+5, '2010-09-03T12:05:08.001Z'); //7am
+ var noon = new angular.mock.TzDate(+5, '2010-09-03T17:05:08.012Z'); //12pm
+ var midnight = new angular.mock.TzDate(+5, '2010-09-03T05:05:08.123Z'); //12am
var earlyDate = new angular.mock.TzDate(+5, '0001-09-03T05:05:08.000Z');
var date;
@@ -192,15 +192,24 @@ describe('filters', function() {
expect(date(morning, "yy-MM-dd HH:mm:ss")).
toEqual('10-09-03 07:05:08');
+ expect(date(morning, "yy-MM-dd HH:mm:ss.sss")).
+ toEqual('10-09-03 07:05:08.001');
+
expect(date(midnight, "yyyy-M-d h=H:m:saZ")).
toEqual('2010-9-3 12=0:5:8AM-0500');
expect(date(midnight, "yyyy-MM-dd hh=HH:mm:ssaZ")).
toEqual('2010-09-03 12=00:05:08AM-0500');
+ expect(date(midnight, "yyyy-MM-dd hh=HH:mm:ss.sssaZ")).
+ toEqual('2010-09-03 12=00:05:08.123AM-0500');
+
expect(date(noon, "yyyy-MM-dd hh=HH:mm:ssaZ")).
toEqual('2010-09-03 12=12:05:08PM-0500');
+ expect(date(noon, "yyyy-MM-dd hh=HH:mm:ss.sssaZ")).
+ toEqual('2010-09-03 12=12:05:08.012PM-0500');
+
expect(date(noon, "EEE, MMM d, yyyy")).
toEqual('Fri, Sep 3, 2010');