feat(facade): add support for Date
Also refactors the dart transpilar to expose the type mappings for future changes.
This commit is contained in:

committed by
Misko Hevery

parent
538b0879dc
commit
674848648a
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user