Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
388649659c | |||
e8ff289a9a |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smarttime",
|
||||
"version": "3.0.9",
|
||||
"version": "3.0.10",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@pushrocks/smarttime",
|
||||
"private": false,
|
||||
"version": "3.0.9",
|
||||
"version": "3.0.10",
|
||||
"description": "handle time in smart ways",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
|
@ -3,6 +3,10 @@ import * as plugins from './smarttime.plugins';
|
||||
export type TAvailableZone = 'Europe/Berlin';
|
||||
|
||||
export class ExtendedDate extends Date {
|
||||
public static fromMillis(milliSeconds: number) {
|
||||
return new ExtendedDate(milliSeconds);
|
||||
}
|
||||
|
||||
public static fromEuropeanDate(europeanDate: string) {
|
||||
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDate);
|
||||
const luxonDate = plugins.luxon.DateTime.utc(
|
||||
@ -17,7 +21,7 @@ export class ExtendedDate extends Date {
|
||||
/** */
|
||||
public static fromEuropeanDateAndTime(
|
||||
europeanDateArg: string,
|
||||
timeArg: string = '12:00',
|
||||
timeArg: string = '12:00:00',
|
||||
zoneArg: TAvailableZone = 'Europe/Berlin'
|
||||
) {
|
||||
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDateArg);
|
||||
|
Reference in New Issue
Block a user