Skip to content

Commit 1f37de9

Browse files
committed
feat(date): Use localized patterns for shorthand format
closes dart-archive#1019
1 parent 4dfd99b commit 1f37de9

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

lib/formatter/date.dart

+20-21
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,35 @@ part of angular.formatter_internal;
77
*
88
* {{ date_expression | date[:format] }}
99
*
10-
* Here `format` may be specified explicitly, or by using one of the following predefined
11-
* localizable names:
10+
* `format` may be specified explicitly, or by using one of the following predefined shorthand:
1211
*
13-
* FORMAT NAME AS DEFINED FOR en_US OUTPUT
14-
* ------------- ---------------------- ---------------------------
15-
* medium MMM d, y h:mm:ss a Sep 3, 2010 12:05:08 pm
16-
* short M/d/yy h:mm a 9/3/10 12:05 pm
17-
* fullDate EEEE, MMMM d, y Friday, September 3, 2010
18-
* longDate MMMM d, y September 3, 2010
19-
* mediumDate MMM d, y Sep 3, 2010
20-
* shortDate M/d/yy 9/3/10
21-
* mediumTime h:mm:ss a 12:05:08 pm
22-
* shortTime h:mm a 12:05 pm
12+
* FORMAT NAME OUTPUT for en_US
13+
* ------------- ---------------------------
14+
* medium Sep 3, 2010 12:05:08 pm
15+
* short 9/3/10 12:05 pm
16+
* fullDate Friday, September 3, 2010
17+
* longDate September 3, 2010
18+
* mediumDate Sep 3, 2010
19+
* shortDate 9/3/10
20+
* mediumTime 12:05:08 pm
21+
* shortTime 12:05 pm
2322
*
2423
*
2524
* For more on explicit formatting of dates and date syntax, see the documentation for the
26-
* [DartFormat class](http://api.dartlang.org/docs/releases/latest/intl/DateFormat.html).
25+
* [DartFormat class](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/intl/intl.DateFormat).
2726
*
2827
*/
2928
@Formatter(name:'date')
3029
class Date implements Function {
3130
static final _MAP = const <String, String> {
32-
'medium': 'MMM d, y h:mm:ss a',
33-
'short': 'M/d/yy h:mm a',
34-
'fullDate': 'EEEE, MMMM d, y',
35-
'longDate': 'MMMM d, y',
36-
'mediumDate': 'MMM d, y',
37-
'shortDate': 'M/d/yy',
38-
'mediumTime': 'h:mm:ss a',
39-
'shortTime': 'h:mm a',
31+
'medium': 'yMMMd jms',
32+
'short': 'yMd jm',
33+
'fullDate': 'yMMMMEEEEd',
34+
'longDate': 'yMMMMd',
35+
'mediumDate': 'yMMMd',
36+
'shortDate': 'yMd',
37+
'mediumTime': 'jms',
38+
'shortTime': 'jm',
4039
};
4140

4241
var _dfs = new Map<String, Map<String, DateFormat>>();

0 commit comments

Comments
 (0)