aboutsummaryrefslogtreecommitdiffstats
path: root/src/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 /src/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 'src/ng')
-rw-r--r--src/ng/filter/filters.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js
index 3459ef88..4680a306 100644
--- a/src/ng/filter/filters.js
+++ b/src/ng/filter/filters.js
@@ -241,6 +241,9 @@ var DATE_FORMATS = {
m: dateGetter('Minutes', 1),
ss: dateGetter('Seconds', 2),
s: dateGetter('Seconds', 1),
+ // while ISO 8601 requires fractions to be prefixed with `.` or `,`
+ // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions
+ sss: dateGetter('Milliseconds', 3),
EEEE: dateStrGetter('Day'),
EEE: dateStrGetter('Day', true),
a: ampmGetter,
@@ -279,6 +282,7 @@ var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+
* * `'m'`: Minute in hour (0-59)
* * `'ss'`: Second in minute, padded (00-59)
* * `'s'`: Second in minute (0-59)
+ * * `'.sss' or ',sss'`: Millisecond in second, padded (000-999)
* * `'a'`: am/pm marker
* * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-1200)
*