feat(facade): add support for Date

Also refactors the dart transpilar to expose
the type mappings for future changes.
This commit is contained in:
Tobias Bosch
2015-02-17 14:29:40 -08:00
committed by Misko Hevery
parent 538b0879dc
commit 674848648a
4 changed files with 30 additions and 9 deletions

View File

@ -1,6 +1,6 @@
library angular.core.facade.lang;
export 'dart:core' show Type, RegExp, print;
export 'dart:core' show Type, RegExp, print, DateTime;
import 'dart:math' as math;
import 'dart:convert' as convert;
@ -183,3 +183,12 @@ class Json {
static parse(String s) => convert.JSON.decode(s);
static stringify(data) => convert.JSON.encode(data);
}
class DateWrapper {
static fromMillis(int ms) {
return new DateTime.fromMillisecondsSinceEpoch(ms);
}
static now() {
return new DateTime.now();
}
}