Compare commits

..

4 Commits

Author SHA1 Message Date
d3dd03534a 3.0.46 2022-11-21 01:19:39 +01:00
9b96779d19 fix(core): update 2022-11-21 01:19:38 +01:00
20b181b2f3 3.0.45 2022-02-02 17:03:59 +01:00
d278722da2 fix(core): update 2022-02-02 17:03:58 +01:00
5 changed files with 15 additions and 7 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@pushrocks/smarttime", "name": "@pushrocks/smarttime",
"version": "3.0.44", "version": "3.0.46",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smarttime", "name": "@pushrocks/smarttime",
"version": "3.0.44", "version": "3.0.46",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^5.0.4", "@pushrocks/lik": "^5.0.4",

View File

@ -1,7 +1,7 @@
{ {
"name": "@pushrocks/smarttime", "name": "@pushrocks/smarttime",
"private": false, "private": false,
"version": "3.0.44", "version": "3.0.46",
"description": "handle time in smart ways", "description": "handle time in smart ways",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smarttime',
version: '3.0.46',
description: 'handle time in smart ways'
}

View File

@ -3,10 +3,10 @@ import { CronManager } from './smarttime.classes.cronmanager';
import { CronParser } from './smarttime.classes.cronparser'; import { CronParser } from './smarttime.classes.cronparser';
export type TJobFunction = (() => void) | (() => Promise<any>); export type TJobFunction = ((triggerTimeArg?: number) => void) | ((triggerTimeArg?: number) => Promise<any>);
export class CronJob { export class CronJob {
public cronParser: CronParser | typeof plugins.croner; public cronParser: typeof plugins.croner;
public status: 'started' | 'stopped' | 'initial' = 'initial'; public status: 'started' | 'stopped' | 'initial' = 'initial';
public cronExpression: string; public cronExpression: string;
public jobFunction: TJobFunction; public jobFunction: TJobFunction;
@ -26,7 +26,7 @@ export class CronJob {
this.getNextExecutionTime(); this.getNextExecutionTime();
} }
if (Date.now() > this.nextExecutionUnix) { if (Date.now() > this.nextExecutionUnix) {
const maybePromise = this.jobFunction(); const maybePromise = this.jobFunction(this.nextExecutionUnix);
if (maybePromise instanceof Promise) { if (maybePromise instanceof Promise) {
maybePromise.catch(e => console.log(e)); maybePromise.catch(e => console.log(e));
} }

View File

@ -85,7 +85,7 @@ export class ExtendedDate extends Date {
public exportToHyphedSortableDate() { public exportToHyphedSortableDate() {
const units = this.exportToUnits(); const units = this.exportToUnits();
return `${units.yearString}-${units.monthString}.${units.dayString}`; return `${units.yearString}-${units.monthString}-${units.dayString}`;
} }
/** /**