@prezly/theme-kit-intl 10.8.0 → 10.9.0

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.
@@ -51,13 +51,17 @@ describe('formatDate', () => {
51
51
  });
52
52
  describe('formatTime', () => {
53
53
  var date = new Date('2024-03-15T10:00:00.000Z');
54
+
55
+ // On 2024-03-15 Europe/London is at a zero UTC offset (pre-DST). The numeric offset is
56
+ // optional in these patterns because `timeZoneName: 'longOffset'` renders a zero offset as
57
+ // bare "GMT" on ICU >= 72 (Node >= 20) but as "GMT+00:00" on older ICU — both are valid.
54
58
  it('appends the timezone offset when a moment-style timeFormat is provided', () => {
55
59
  var result = (0, _lib.formatTime)(date, {
56
60
  locale: 'en',
57
61
  timezone: 'Europe/London',
58
62
  timeFormat: 'HH:mm'
59
63
  });
60
- expect(result).toMatch(/^10:00 GMT[+-]\d{2}:\d{2}$/);
64
+ expect(result).toMatch(/^10:00 GMT(?:[+-]\d{2}:\d{2})?$/);
61
65
  });
62
66
  it('supports 12-hour moment-style format', () => {
63
67
  var result = (0, _lib.formatTime)(date, {
@@ -65,6 +69,6 @@ describe('formatTime', () => {
65
69
  timezone: 'Europe/London',
66
70
  timeFormat: 'hh:mm a'
67
71
  });
68
- expect(result).toMatch(/^10:00 (am|AM) GMT[+-]\d{2}:\d{2}$/);
72
+ expect(result).toMatch(/^10:00 (am|AM) GMT(?:[+-]\d{2}:\d{2})?$/);
69
73
  });
70
74
  });
@@ -49,13 +49,17 @@ describe('formatDate', () => {
49
49
  });
50
50
  describe('formatTime', () => {
51
51
  var date = new Date('2024-03-15T10:00:00.000Z');
52
+
53
+ // On 2024-03-15 Europe/London is at a zero UTC offset (pre-DST). The numeric offset is
54
+ // optional in these patterns because `timeZoneName: 'longOffset'` renders a zero offset as
55
+ // bare "GMT" on ICU >= 72 (Node >= 20) but as "GMT+00:00" on older ICU — both are valid.
52
56
  it('appends the timezone offset when a moment-style timeFormat is provided', () => {
53
57
  var result = formatTime(date, {
54
58
  locale: 'en',
55
59
  timezone: 'Europe/London',
56
60
  timeFormat: 'HH:mm'
57
61
  });
58
- expect(result).toMatch(/^10:00 GMT[+-]\d{2}:\d{2}$/);
62
+ expect(result).toMatch(/^10:00 GMT(?:[+-]\d{2}:\d{2})?$/);
59
63
  });
60
64
  it('supports 12-hour moment-style format', () => {
61
65
  var result = formatTime(date, {
@@ -63,6 +67,6 @@ describe('formatTime', () => {
63
67
  timezone: 'Europe/London',
64
68
  timeFormat: 'hh:mm a'
65
69
  });
66
- expect(result).toMatch(/^10:00 (am|AM) GMT[+-]\d{2}:\d{2}$/);
70
+ expect(result).toMatch(/^10:00 (am|AM) GMT(?:[+-]\d{2}:\d{2})?$/);
67
71
  });
68
72
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/theme-kit-intl",
3
- "version": "10.8.0",
3
+ "version": "10.9.0",
4
4
  "description": "Translations for Prezly themes",
5
5
  "type": "module",
6
6
  "main": "build/index.mjs",
@@ -27,7 +27,7 @@
27
27
  "npm": ">= 7.x"
28
28
  },
29
29
  "scripts": {
30
- "clean": "rimraf build/* *.tsbuildinfo",
30
+ "clean": "rimraf --glob build/* *.tsbuildinfo",
31
31
  "prebuild": "pnpm clean && pnpm build:locales && pnpm format",
32
32
  "build": "pnpm intl:compile && pnpm build:types && pnpm build:esm && pnpm build:cjs",
33
33
  "build:locales": "node ./build-locales.cjs > src/locales/supportedLocales.ts && biome format --write ./src/locales/supportedLocales.ts",
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "c115dca569eda9f064bc34bae593377e4921f8bd"
77
+ "gitHead": "fe4387818aef058e6500d2370abbbebed9eeb8ff"
78
78
  }