cron 4.1.1 → 4.1.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [4.1.2](https://github.com/kelektiv/node-cron/compare/v4.1.1...v4.1.2) (2025-03-28)
2
+
3
+ ### 🐛 Bug Fixes
4
+
5
+ * timezone should default to local ([#972](https://github.com/kelektiv/node-cron/issues/972)) ([d2b1aac](https://github.com/kelektiv/node-cron/commit/d2b1aac9c705e111a466daa85b95bed9f7725abd)), closes [#971](https://github.com/kelektiv/node-cron/issues/971) [#971](https://github.com/kelektiv/node-cron/issues/971)
6
+
1
7
  ## [4.1.1](https://github.com/kelektiv/node-cron/compare/v4.1.0...v4.1.1) (2025-03-26)
2
8
 
3
9
  ### 🐛 Bug Fixes
package/dist/time.js CHANGED
@@ -26,6 +26,10 @@ class CronTime {
26
26
  if (utcOffset != null) {
27
27
  this.utcOffset = utcOffset;
28
28
  }
29
+ if (timeZone == null && utcOffset == null) {
30
+ const systemTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
31
+ this.timeZone = systemTimezone;
32
+ }
29
33
  if (source instanceof Date || source instanceof luxon_1.DateTime) {
30
34
  this.source =
31
35
  source instanceof Date ? luxon_1.DateTime.fromJSDate(source) : source;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cron",
3
3
  "description": "Cron jobs for your node",
4
- "version": "4.1.1",
4
+ "version": "4.1.2",
5
5
  "author": "Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/kelektiv/node-cron/issues"
@@ -18,9 +18,9 @@
18
18
  "lint:prettier": "prettier ./**/*.{json,md,yml} --check",
19
19
  "lint": "npm run lint:eslint && npm run lint:prettier",
20
20
  "lint:fix": "npm run lint:eslint -- --fix && npm run lint:prettier -- --write",
21
- "test": "jest --coverage",
22
- "test:watch": "jest --watch --coverage",
23
- "test:fuzz": "jest --testMatch='**/*.fuzz.ts' --coverage=false --testTimeout=120000",
21
+ "test": "cross-env TZ='Europe/Paris' jest --coverage",
22
+ "test:watch": "cross-env TZ='Europe/Paris' jest --watch --coverage",
23
+ "test:fuzz": "cross-env TZ='Europe/Paris' jest --testMatch='**/*.fuzz.ts' --coverage=false --testTimeout=120000",
24
24
  "prepare": "husky"
25
25
  },
26
26
  "dependencies": {
@@ -45,6 +45,7 @@
45
45
  "@types/node": "22.13.11",
46
46
  "@types/sinon": "17.0.4",
47
47
  "chai": "5.2.0",
48
+ "cross-env": "7.0.3",
48
49
  "eslint": "8.57.1",
49
50
  "eslint-config-prettier": "9.1.0",
50
51
  "eslint-plugin-jest": "27.9.0",