Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3227)

Unified Diff: third_party/pkg/angular/lib/filter/date.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pkg/angular/lib/filter/currency.dart ('k') | third_party/pkg/angular/lib/filter/filter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/lib/filter/date.dart
diff --git a/third_party/pkg/angular/lib/formatter/date.dart b/third_party/pkg/angular/lib/filter/date.dart
similarity index 82%
rename from third_party/pkg/angular/lib/formatter/date.dart
rename to third_party/pkg/angular/lib/filter/date.dart
index 0268b468df77c5c7f19f1565c65b01650e676cb9..75d528703124c26779bb932eff0f3d4afc8d660a 100644
--- a/third_party/pkg/angular/lib/formatter/date.dart
+++ b/third_party/pkg/angular/lib/filter/date.dart
@@ -1,4 +1,4 @@
-part of angular.formatter_internal;
+part of angular.filter;
/**
* Formats date to a string based on the requested format.
@@ -20,8 +20,8 @@ part of angular.formatter_internal;
* {{ date_expression | date[:format] }}
*
*/
-@Formatter(name:'date')
-class Date implements Function {
+@NgFilter(name:'date')
+class DateFilter implements Function {
static final _MAP = const <String, String> {
'medium': 'MMM d, y h:mm:ss a',
'short': 'M/d/yy h:mm a',
@@ -33,7 +33,7 @@ class Date implements Function {
'shortTime': 'h:mm a',
};
- var _dfs = new Map<String, Map<String, DateFormat>>();
+ var _dfs = <String, DateFormat>{};
/**
* [date]: Date to format either as Date object, milliseconds
@@ -52,13 +52,13 @@ class Date implements Function {
if (date is String) date = DateTime.parse(date);
if (date is num) date = new DateTime.fromMillisecondsSinceEpoch(date);
if (date is! DateTime) return date;
- if (_MAP.containsKey(format)) format = _MAP[format];
- var verifiedLocale = Intl.verifiedLocale(Intl.getCurrentLocale(), DateFormat.localeExists);
- _dfs.putIfAbsent(verifiedLocale, () => new Map<String, DateFormat>());
- var df = _dfs[verifiedLocale][format];
+ var df = _dfs[format];
if (df == null) {
+ if (_MAP.containsKey(format)) {
+ format = _MAP[format];
+ }
df = new DateFormat(format);
- _dfs[verifiedLocale][format] = df;
+ _dfs[format] = df;
}
return df.format(date);
}
« no previous file with comments | « third_party/pkg/angular/lib/filter/currency.dart ('k') | third_party/pkg/angular/lib/filter/filter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698