@synerise/ds-date-range-picker 2.0.3 → 2.0.4

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
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@2.0.3...@synerise/ds-date-range-picker@2.0.4) (2026-09-08)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **date-range-picker:** encode non-whole-hour timezone offsets correctly ([a51b393](https://github.com/Synerise/synerise-design/commit/a51b393cad84dcb2da67dcc3da2dabf7d22cf37a))
11
+
6
12
  ## [2.0.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@2.0.2...@synerise/ds-date-range-picker@2.0.3) (2026-09-07)
7
13
 
8
14
  **Note:** Version bump only for package @synerise/ds-date-range-picker
package/CLAUDE.md CHANGED
@@ -12,7 +12,7 @@ src/
12
12
  RawDateRangePicker.tsx — core picker logic without popover
13
13
  date.types.ts — DateRange, DateFilter, RelativeUnits, RangeKey
14
14
  constants.tsx — MODES, COLUMNS, presets, POPOVER_*_CONFIG
15
- utils.ts — normalizeRange, getDefaultTexts, toIsoString, DEFAULT_RANGE
15
+ utils.ts — normalizeRange, getDefaultTexts, DEFAULT_RANGE (toIsoString is re-exported from ds-core)
16
16
  fns.ts — re-exports / wrappers around date-fns
17
17
  RangePicker/ — absolute date picker (dual-month calendar)
18
18
  RelativeRangePicker/ — relative preset + custom range picker
@@ -114,7 +114,7 @@ Re-export of `format` from `date-fns` — use for consistent date formatting acr
114
114
 
115
115
  ### `utils`
116
116
 
117
- Namespace export: `normalizeRange`, `toIsoString`, `toIsoStringWithoutZone`, `getDefaultTexts`, `DEFAULT_RANGE`, `START_OF`, `END_OF`.
117
+ Namespace export: `normalizeRange`, `toIsoString` (re-exported from `@synerise/ds-core`), `toIsoStringWithoutZone`, `getDefaultTexts`, `DEFAULT_RANGE`, `START_OF`, `END_OF`.
118
118
 
119
119
  ### `CONST`
120
120
 
@@ -198,7 +198,7 @@ Addons (relative picker, filter) appear below the calendar and are toggled via `
198
198
 
199
199
  - `react-day-picker ^10` — calendar grid rendering inside `RangePicker` (see the v10 notes in `ds-date-picker`'s CLAUDE.md; day cells now contain a `<button class="DayPicker-Day-Button">`)
200
200
  - `@synerise/ds-popover` — floating popover (floating-ui underneath)
201
- - `date-fns ^2` + `date-fns-tz 1.1.4` — date arithmetic and timezone support
201
+ - `date-fns ^2` — date arithmetic. Timezone handling is not this package's: `toIsoString` is re-exported from `@synerise/ds-core`, which owns the wall-clock convention and the `@date-fns/tz` dependency behind it
202
202
  - `dayjs ^1.8` — used in parts of `RangeFilter`
203
203
  - `ramda ^0.27` — functional utilities in `RangeFilter`
204
204
  - `react-intl` — i18n (peer dependency via host app)
@@ -16,7 +16,8 @@ import { isLifetime } from "./RelativeRangePicker/Elements/RangeDropdown/RangeDr
16
16
  import RelativeRangePicker from "./RelativeRangePicker/RelativeRangePicker.js";
17
17
  import { MODES, ALL_TIME, RELATIVE, ABSOLUTE, RELATIVE_PRESETS, ABSOLUTE_PRESETS, CUSTOM_RANGE_KEY } from "./constants.js";
18
18
  import relativeToAbsolute from "./dateUtils/relativeToAbsolute.js";
19
- import { normalizeRange, getDefaultTexts, toIsoString } from "./utils.js";
19
+ import { normalizeRange, getDefaultTexts } from "./utils.js";
20
+ import { toIsoString } from "@synerise/ds-core";
20
21
  const isRelative = (dateRange) => {
21
22
  const isLegacyCustom = Object.keys(dateRange).includes("key") && dateRange.key === void 0;
22
23
  return dateRange.key && (RELATIVE_PRESETS.map((preset) => preset.key).includes(dateRange.key) || dateRange.key === CUSTOM_RANGE_KEY) || isLegacyCustom;
package/dist/utils.d.ts CHANGED
@@ -4,7 +4,16 @@ import { DateRange } from './date.types';
4
4
  import { default as END_OF } from './dateUtils/endOf';
5
5
  import { default as START_OF } from './dateUtils/startOf';
6
6
  export { START_OF, END_OF };
7
- export declare function toIsoString(date: Date, timeZone?: string | undefined): string;
7
+ /**
8
+ * Re-exported rather than implemented here. This package used to carry its own copy, which took
9
+ * `Math.abs(offset) % 60` of an offset in *milliseconds* — so every zone that is not a whole number
10
+ * of hours ahead of UTC (India, Adelaide, Kathmandu, Chatham, Newfoundland) encoded as `:00`
11
+ * minutes. It also looked the offset up against the date's UTC fields rather than the wall clock it
12
+ * carries, which picked the wrong side of a DST transition.
13
+ *
14
+ * Kept exported because `utils` is part of this package's public surface (`export * as utils`).
15
+ */
16
+ export { toIsoString } from '@synerise/ds-core';
8
17
  export declare function toIsoStringWithoutZone(date: Date): string;
9
18
  export declare const normalizeRange: (range: DateRange) => DateRange;
10
19
  export declare const getDefaultTexts: (intl: IntlShape, disableDefault?: boolean, texts?: Partial<Texts>) => Texts;
package/dist/utils.js CHANGED
@@ -1,4 +1,3 @@
1
- import { getTimezoneOffset } from "date-fns-tz";
2
1
  import fnsMax from "date-fns/max";
3
2
  import fnsMin from "date-fns/min";
4
3
  import omit from "lodash.omit";
@@ -6,20 +5,13 @@ import { ABSOLUTE, RELATIVE, CUSTOM_RANGE_KEY } from "./constants.js";
6
5
  import ADD from "./dateUtils/add.js";
7
6
  import END_OF from "./dateUtils/endOf.js";
8
7
  import START_OF from "./dateUtils/startOf.js";
8
+ import { toIsoString } from "@synerise/ds-core";
9
9
  const rmvTZOffset = (dateString) => {
10
10
  const date = dateString.toString();
11
11
  const finalDate = date.replace(/[+-]\d\d:\d\d$/, "");
12
12
  return finalDate;
13
13
  };
14
14
  const pad = (num) => (num < 10 ? "0" : "") + num;
15
- function toIsoString(date, timeZone = "UTC") {
16
- if (!timeZone) {
17
- return new Date(date).toISOString();
18
- }
19
- const timeZoneOffset = getTimezoneOffset(timeZone, date);
20
- const dif = timeZoneOffset >= 0 ? "+" : "-";
21
- return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}${dif}${pad(Math.floor(Math.abs(timeZoneOffset) / 60 / 60 / 1e3))}:${pad(Math.abs(timeZoneOffset) % 60)}`;
22
- }
23
15
  function toIsoStringWithoutZone(date) {
24
16
  return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
25
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-date-range-picker",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Date-Range-Picker UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -43,28 +43,27 @@
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
45
  "@date-fns/upgrade": "^1.0.3",
46
- "@synerise/ds-badge": "^2.0.1",
47
- "@synerise/ds-button": "^2.0.1",
48
- "@synerise/ds-button-group": "^2.0.1",
49
- "@synerise/ds-date-picker": "^2.0.2",
50
- "@synerise/ds-dropdown": "^2.0.2",
51
- "@synerise/ds-form-field": "^2.0.1",
46
+ "@synerise/ds-badge": "^2.0.2",
47
+ "@synerise/ds-button": "^2.0.2",
48
+ "@synerise/ds-button-group": "^2.0.2",
49
+ "@synerise/ds-date-picker": "^2.0.3",
50
+ "@synerise/ds-dropdown": "^2.0.3",
51
+ "@synerise/ds-form-field": "^2.0.2",
52
52
  "@synerise/ds-icon": "^2.1.0",
53
- "@synerise/ds-inline-edit": "^2.0.2",
54
- "@synerise/ds-input": "^2.0.2",
55
- "@synerise/ds-input-number": "^2.0.2",
56
- "@synerise/ds-list-item": "^2.0.1",
57
- "@synerise/ds-manageable-list": "^2.0.2",
58
- "@synerise/ds-popover": "^2.0.0",
53
+ "@synerise/ds-inline-edit": "^2.0.3",
54
+ "@synerise/ds-input": "^2.0.3",
55
+ "@synerise/ds-input-number": "^2.0.3",
56
+ "@synerise/ds-list-item": "^2.0.2",
57
+ "@synerise/ds-manageable-list": "^2.1.0",
58
+ "@synerise/ds-popover": "^2.0.1",
59
59
  "@synerise/ds-scrollbar": "^2.0.1",
60
- "@synerise/ds-select": "^2.0.3",
61
- "@synerise/ds-slider": "^2.0.1",
62
- "@synerise/ds-tag": "^2.0.1",
63
- "@synerise/ds-time-picker": "^2.0.2",
64
- "@synerise/ds-tooltip": "^2.0.1",
60
+ "@synerise/ds-select": "^2.0.4",
61
+ "@synerise/ds-slider": "^2.0.2",
62
+ "@synerise/ds-tag": "^2.0.2",
63
+ "@synerise/ds-time-picker": "^2.0.3",
64
+ "@synerise/ds-tooltip": "^2.0.2",
65
65
  "@synerise/ds-utils": "^2.0.0",
66
66
  "date-fns": "^2.16.1",
67
- "date-fns-tz": "1.1.4",
68
67
  "dayjs": "^1.8.35",
69
68
  "lodash.clonedeep": "^4.5.0",
70
69
  "lodash.flatten": "^4.4.0",
@@ -102,5 +101,5 @@
102
101
  "react-intl": ">=3.12.0 <= 6.8",
103
102
  "styled-components": "^5.3.3"
104
103
  },
105
- "gitHead": "788eba77544b291f7e938864a3994df4b4d904e2"
104
+ "gitHead": "e0dced8fd3a1194eff2fafc1b7e385b29238af88"
106
105
  }