fix(core): update
This commit is contained in:
parent
6bca8557f9
commit
d720b8b084
@ -135,13 +135,3 @@ pages:
|
|||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
windowsCompatibility:
|
|
||||||
image: stefanscherer/node-windows:10-build-tools
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npm install & npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- windows
|
|
||||||
allow_failure: true
|
|
||||||
|
24
package-lock.json
generated
24
package-lock.json
generated
@ -251,14 +251,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/luxon": {
|
"@types/luxon": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-1.4.1.tgz",
|
||||||
"integrity": "sha512-jECW+lbzPICLGqN/dBdX6Lwn5s84okwM2EVjcYim7hkh5+Ebej8kjxY7InBlsORNjGe8v7lPpd/88a0qkoEcuA=="
|
"integrity": "sha512-mYv/gbkOJ40CDgR8st5sosfFNrJncdlkpdzQSNRdU86UQg3oWWmll4AO/7B8F5FlBC6YrIXqXDSnkoCBqo+uMA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "10.12.0",
|
"version": "10.12.10",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.10.tgz",
|
||||||
"integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==",
|
"integrity": "sha512-8xZEYckCbUVgK8Eg7lf5Iy4COKJ5uXlnIOnePN0WUwSQggy9tolM+tDJf7wMOnT/JT/W9xDYIaYggt3mRV2O5w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/vinyl": {
|
"@types/vinyl": {
|
||||||
@ -718,9 +718,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"luxon": {
|
"luxon": {
|
||||||
"version": "1.4.3",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.8.0.tgz",
|
||||||
"integrity": "sha512-hujVJ+Q2RnaIiHKAupwusgpHXYICxzXJNoPkqkGIfmP+lLZWFTD6gEP+URRs/vh5gI1KwfMimVrzM9309RE0tA=="
|
"integrity": "sha512-F742cYUYB7X+LXY3cIn6THZUBqRBjeAvF+CWE2i3+eKcv2bzsCsnRsBYL8Qrqzp1dfs6HsVcSjfKt2RcrtUElw=="
|
||||||
},
|
},
|
||||||
"make-error": {
|
"make-error": {
|
||||||
"version": "1.3.4",
|
"version": "1.3.4",
|
||||||
@ -1005,9 +1005,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tslint-config-prettier": {
|
"tslint-config-prettier": {
|
||||||
"version": "1.15.0",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.16.0.tgz",
|
||||||
"integrity": "sha512-06CgrHJxJmNYVgsmeMoa1KXzQRoOdvfkqnJth6XUkNeOz707qxN0WfxfhYwhL5kXHHbYJRby2bqAPKwThlZPhw==",
|
"integrity": "sha512-zu6RAcpBtqdvhT6KpBh9kRPYATjOf9BnRi718kNqVKFjEgSE4rFrPprFju1YJrkOa3RbtbWI1ZSuLd2NBX1MDw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"tsutils": {
|
"tsutils": {
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
"@gitzone/tsrun": "^1.1.13",
|
"@gitzone/tsrun": "^1.1.13",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.15",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.7",
|
||||||
"@types/node": "^10.12.0",
|
"@types/node": "^10.12.10",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.11.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.16.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^2.0.5",
|
||||||
"@types/luxon": "^1.4.0",
|
"@types/luxon": "^1.4.1",
|
||||||
"luxon": "^1.4.3"
|
"luxon": "^1.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,8 +8,12 @@ tap.test('should create a valid JavaScript Date from European TimeStamp', async
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should create a date and time with European Format', async () => {
|
tap.test('should create a date and time with European Format', async () => {
|
||||||
const extendedDate = smarttime.ExtendedDate.fromEuropeanDateAndTime('9.8.2018', '08:00:00', 'Europe/Berlin');
|
const extendedDate = smarttime.ExtendedDate.fromEuropeanDateAndTime(
|
||||||
|
'9.8.2018',
|
||||||
|
'08:00:00',
|
||||||
|
'Europe/Berlin'
|
||||||
|
);
|
||||||
console.log(extendedDate);
|
console.log(extendedDate);
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -24,13 +24,12 @@ export class ExtendedDate extends Date {
|
|||||||
const sliceDate = (dateString: string) => {
|
const sliceDate = (dateString: string) => {
|
||||||
return `0${dateString}`.slice(-2);
|
return `0${dateString}`.slice(-2);
|
||||||
};
|
};
|
||||||
const dateTimeString = `${dateArray[3]}-${sliceDate(dateArray[2])}-${sliceDate(dateArray[1])}T${timeArg}`;
|
const dateTimeString = `${dateArray[3]}-${sliceDate(dateArray[2])}-${sliceDate(
|
||||||
const luxonDate = plugins.luxon.DateTime.fromISO(
|
dateArray[1]
|
||||||
dateTimeString,
|
)}T${timeArg}`;
|
||||||
{
|
const luxonDate = plugins.luxon.DateTime.fromISO(dateTimeString, {
|
||||||
zone: zoneArg
|
zone: zoneArg
|
||||||
}
|
});
|
||||||
);
|
|
||||||
const unixMilli = luxonDate.toMillis();
|
const unixMilli = luxonDate.toMillis();
|
||||||
return new ExtendedDate(unixMilli);
|
return new ExtendedDate(unixMilli);
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,14 @@ export class Timer {
|
|||||||
this.currentTimeout = setTimeout(() => {
|
this.currentTimeout = setTimeout(() => {
|
||||||
this.completedDeferred.resolve();
|
this.completedDeferred.resolve();
|
||||||
}, this.timeLeft);
|
}, this.timeLeft);
|
||||||
|
} else {
|
||||||
|
throw new Error('timer has NOT been started before. Please use .start() instead');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public reset() {
|
||||||
|
this.pause();
|
||||||
|
this.startedAt = null;
|
||||||
|
this.pausedAt = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
17
tslint.json
17
tslint.json
@ -1,6 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": [
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
"tslint:latest",
|
"rules": {
|
||||||
"tslint-config-prettier"
|
"semicolon": [true, "always"],
|
||||||
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"member-ordering": {
|
||||||
|
"options":{
|
||||||
|
"order": [
|
||||||
|
"static-method"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user