diff --git a/modules/angular2/src/core/facade/lang.dart b/modules/angular2/src/core/facade/lang.dart index 7516481c6a..0d2fb27aa7 100644 --- a/modules/angular2/src/core/facade/lang.dart +++ b/modules/angular2/src/core/facade/lang.dart @@ -266,6 +266,10 @@ class DateWrapper { return new DateTime(year, month, day, hour, minutes, seconds, milliseconds); } + static DateTime fromISOString(String str) { + return DateTime.parse(str); + } + static DateTime fromMillis(int ms) { return new DateTime.fromMillisecondsSinceEpoch(ms, isUtc: true); } diff --git a/modules/angular2/src/core/facade/lang.ts b/modules/angular2/src/core/facade/lang.ts index 793847f2b5..4385a98216 100644 --- a/modules/angular2/src/core/facade/lang.ts +++ b/modules/angular2/src/core/facade/lang.ts @@ -325,6 +325,7 @@ export class DateWrapper { minutes: number = 0, seconds: number = 0, milliseconds: number = 0): Date { return new Date(year, month - 1, day, hour, minutes, seconds, milliseconds); } + static fromISOString(str: string): Date { return new Date(str); } static fromMillis(ms: number): Date { return new Date(ms); } static toMillis(date: Date): number { return date.getTime(); } static now(): Date { return new Date(); }