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

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

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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/filter/date.dart b/third_party/pkg/angular/lib/filter/date.dart
deleted file mode 100644
index 75d528703124c26779bb932eff0f3d4afc8d660a..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/lib/filter/date.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-part of angular.filter;
-
-/**
- * Formats date to a string based on the requested format.
- * See Dart http://api.dartlang.org/docs/releases/latest/intl/DateFormat.html
- * for full formating options.
- *
- * - `medium`: equivalent to `MMM d, y h:mm:ss a` for en_US locale (e.g. Sep 3, 2010 12:05:08 pm)
- * - `short`: equivalent to `M/d/yy h:mm a` for en_US locale (e.g. 9/3/10 12:05 pm)
- * - `fullDate`: equivalent to `EEEE, MMMM d, y` for en_US locale (e.g. Friday, September 3, 2010)
- * - `longDate`: equivalent to `MMMM d, y` for en_US locale (e.g. September 3, 2010)
- * - `mediumDate`: equivalent to `MMM d, y` for en_US locale (e.g. Sep 3, 2010)
- * - `shortDate`: equivalent to `M/d/yy` for en_US locale (e.g. 9/3/10)
- * - `mediumTime`: equivalent to `h:mm:ss a` for en_US locale (e.g. 12:05:08 pm)
- * - `shortTime`: equivalent to `h:mm a` for en_US locale (e.g. 12:05 pm)
- *
- *
- * Usage:
- *
- * {{ date_expression | date[:format] }}
- *
- */
-@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',
- 'fullDate': 'EEEE, MMMM d, y',
- 'longDate': 'MMMM d, y',
- 'mediumDate': 'MMM d, y',
- 'shortDate': 'M/d/yy',
- 'mediumTime': 'h:mm:ss a',
- 'shortTime': 'h:mm a',
- };
-
- var _dfs = <String, DateFormat>{};
-
- /**
- * [date]: Date to format either as Date object, milliseconds
- * ([string] or [num]) or various ISO 8601 datetime string formats
- * (e.g. `yyyy-MM-ddTHH:mm:ss.SSSZ` and its shorter versions like
- * `yyyy-MM-ddTHH:mmZ`, `yyyy-MM-dd` or `yyyyMMddTHHmmssZ`). If no
- * timezone is specified in the string input, the time is considered to
- * be in the local timezone.
- *
- * [format]: Formatting rules (see Description). If not specified,
- * mediumDate is used
- *
- */
- dynamic call(Object date, [String format = 'mediumDate']) {
- if (date == '' || date == null) return date;
- if (date is String) date = DateTime.parse(date);
- if (date is num) date = new DateTime.fromMillisecondsSinceEpoch(date);
- if (date is! DateTime) return date;
- var df = _dfs[format];
- if (df == null) {
- if (_MAP.containsKey(format)) {
- format = _MAP[format];
- }
- df = new DateFormat(format);
- _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