croner 4.1.93 → 4.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/croner.cjs +3 -3
- package/package.json +1 -1
- package/src/croner.js +1 -1
- package/src/timezone.js +2 -2
- package/types/croner.d.ts +4 -4
- package/types/timezone.d.ts +3 -3
package/dist/croner.cjs
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* (for example) will return local time in new york, but getUTCHours()
|
|
17
17
|
* will return something irrelevant.
|
|
18
18
|
*
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {Date} date - Input date
|
|
20
20
|
* @param {string} tzString - Timezone string in Europe/Stockholm format
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {Date}
|
|
22
22
|
*/
|
|
23
23
|
function convertTZ(date, tzString) {
|
|
24
24
|
return new Date(date.toLocaleString("en-US", {timeZone: tzString}));
|
|
@@ -751,7 +751,7 @@
|
|
|
751
751
|
* Cron entrypoint
|
|
752
752
|
*
|
|
753
753
|
* @constructor
|
|
754
|
-
* @param {string|
|
|
754
|
+
* @param {string|Date} pattern - Input pattern, input date, or input ISO 8601 time string
|
|
755
755
|
* @param {CronOptions|Function} [options] - Options
|
|
756
756
|
* @param {Function} [func] - Function to be run each iteration of pattern
|
|
757
757
|
* @returns {Cron}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "croner",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.94",
|
|
4
4
|
"description": "Trigger functions and/or evaluate cron expressions in JavaScript. No dependencies. Most features. All environmens.",
|
|
5
5
|
"author": "Hexagon <github.com/hexagon>",
|
|
6
6
|
"homepage": "https://hexagon.github.io/croner",
|
package/src/croner.js
CHANGED
|
@@ -58,7 +58,7 @@ const maxDelay = Math.pow(2, 32 - 1) - 1;
|
|
|
58
58
|
* Cron entrypoint
|
|
59
59
|
*
|
|
60
60
|
* @constructor
|
|
61
|
-
* @param {string|
|
|
61
|
+
* @param {string|Date} pattern - Input pattern, input date, or input ISO 8601 time string
|
|
62
62
|
* @param {CronOptions|Function} [options] - Options
|
|
63
63
|
* @param {Function} [func] - Function to be run each iteration of pattern
|
|
64
64
|
* @returns {Cron}
|
package/src/timezone.js
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* (for example) will return local time in new york, but getUTCHours()
|
|
11
11
|
* will return something irrelevant.
|
|
12
12
|
*
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {Date} date - Input date
|
|
14
14
|
* @param {string} tzString - Timezone string in Europe/Stockholm format
|
|
15
|
-
* @returns {
|
|
15
|
+
* @returns {Date}
|
|
16
16
|
*/
|
|
17
17
|
function convertTZ(date, tzString) {
|
|
18
18
|
return new Date(date.toLocaleString("en-US", {timeZone: tzString}));
|
package/types/croner.d.ts
CHANGED
|
@@ -40,23 +40,23 @@ export type CronOptions = {
|
|
|
40
40
|
* Cron entrypoint
|
|
41
41
|
*
|
|
42
42
|
* @constructor
|
|
43
|
-
* @param {string|
|
|
43
|
+
* @param {string|Date} pattern - Input pattern, input date, or input ISO 8601 time string
|
|
44
44
|
* @param {CronOptions|Function} [options] - Options
|
|
45
45
|
* @param {Function} [func] - Function to be run each iteration of pattern
|
|
46
46
|
* @returns {Cron}
|
|
47
47
|
*/
|
|
48
|
-
export function Cron(pattern: string |
|
|
48
|
+
export function Cron(pattern: string | Date, options?: CronOptions | Function, func?: Function): Cron;
|
|
49
49
|
export class Cron {
|
|
50
50
|
/**
|
|
51
51
|
* Cron entrypoint
|
|
52
52
|
*
|
|
53
53
|
* @constructor
|
|
54
|
-
* @param {string|
|
|
54
|
+
* @param {string|Date} pattern - Input pattern, input date, or input ISO 8601 time string
|
|
55
55
|
* @param {CronOptions|Function} [options] - Options
|
|
56
56
|
* @param {Function} [func] - Function to be run each iteration of pattern
|
|
57
57
|
* @returns {Cron}
|
|
58
58
|
*/
|
|
59
|
-
constructor(pattern: string |
|
|
59
|
+
constructor(pattern: string | Date, options?: CronOptions | Function, func?: Function);
|
|
60
60
|
/** @type {CronOptions} */
|
|
61
61
|
options: CronOptions;
|
|
62
62
|
once: CronPattern;
|
package/types/timezone.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export default convertTZ;
|
|
|
11
11
|
* (for example) will return local time in new york, but getUTCHours()
|
|
12
12
|
* will return something irrelevant.
|
|
13
13
|
*
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {Date} date - Input date
|
|
15
15
|
* @param {string} tzString - Timezone string in Europe/Stockholm format
|
|
16
|
-
* @returns {
|
|
16
|
+
* @returns {Date}
|
|
17
17
|
*/
|
|
18
|
-
declare function convertTZ(date:
|
|
18
|
+
declare function convertTZ(date: Date, tzString: string): Date;
|