feat(facade): add fromISODate method
This commit is contained in:
parent
f529236bfc
commit
440fd11c72
|
@ -266,6 +266,10 @@ class DateWrapper {
|
||||||
return new DateTime(year, month, day, hour, minutes, seconds, milliseconds);
|
return new DateTime(year, month, day, hour, minutes, seconds, milliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DateTime fromISOString(String str) {
|
||||||
|
return DateTime.parse(str);
|
||||||
|
}
|
||||||
|
|
||||||
static DateTime fromMillis(int ms) {
|
static DateTime fromMillis(int ms) {
|
||||||
return new DateTime.fromMillisecondsSinceEpoch(ms, isUtc: true);
|
return new DateTime.fromMillisecondsSinceEpoch(ms, isUtc: true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,6 +325,7 @@ export class DateWrapper {
|
||||||
minutes: number = 0, seconds: number = 0, milliseconds: number = 0): Date {
|
minutes: number = 0, seconds: number = 0, milliseconds: number = 0): Date {
|
||||||
return new Date(year, month - 1, day, hour, minutes, seconds, milliseconds);
|
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 fromMillis(ms: number): Date { return new Date(ms); }
|
||||||
static toMillis(date: Date): number { return date.getTime(); }
|
static toMillis(date: Date): number { return date.getTime(); }
|
||||||
static now(): Date { return new Date(); }
|
static now(): Date { return new Date(); }
|
||||||
|
|
Loading…
Reference in New Issue