Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
c968e156ae | |||
b5509711e7 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarttime",
|
"name": "@pushrocks/smarttime",
|
||||||
"version": "3.0.11",
|
"version": "3.0.12",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarttime",
|
"name": "@pushrocks/smarttime",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "3.0.11",
|
"version": "3.0.12",
|
||||||
"description": "handle time in smart ways",
|
"description": "handle time in smart ways",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@ -20,6 +20,10 @@ export class ExtendedDate extends Date {
|
|||||||
return new ExtendedDate(milliSeconds);
|
return new ExtendedDate(milliSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static fromDate(dateArg: Date) {
|
||||||
|
return new ExtendedDate(dateArg.getTime());
|
||||||
|
}
|
||||||
|
|
||||||
public static fromEuropeanDate(europeanDate: string) {
|
public static fromEuropeanDate(europeanDate: string) {
|
||||||
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDate);
|
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDate);
|
||||||
const luxonDate = plugins.luxon.DateTime.utc(
|
const luxonDate = plugins.luxon.DateTime.utc(
|
||||||
@ -68,6 +72,9 @@ export class ExtendedDate extends Date {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
|
public timezone: TAvailableZone;
|
||||||
|
|
||||||
|
|
||||||
constructor(unixMilli: number) {
|
constructor(unixMilli: number) {
|
||||||
super(unixMilli);
|
super(unixMilli);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user