react-timezone-range-picker 0.1.7 → 0.2.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.
- package/README.md +30 -0
- package/dist/AroundTimePanel/index.d.ts.map +1 -1
- package/dist/AroundTimePanel/util.d.ts +2 -0
- package/dist/AroundTimePanel/util.d.ts.map +1 -1
- package/dist/RelativeTimePanel/timeOptions.d.ts.map +1 -1
- package/dist/StartEndTimePanel/index.d.ts.map +1 -1
- package/dist/TimezoneRangePicker/BasicPickerView.d.ts.map +1 -1
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1219 -1190
- package/dist/index.es.js.map +1 -1
- package/dist/interfaces/index.d.ts +17 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/util/dateTime.d.ts +17 -1
- package/dist/util/dateTime.d.ts.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -49,6 +49,23 @@ Set `options.allowedTimeRange` to `"past"`, `"future"`, or `"all"` (the default)
|
|
|
49
49
|
|
|
50
50
|
`Today`, `Yesterday`, and `Tomorrow` use complete calendar-day boundaries (for example, Today 00:00 through Tomorrow 00:00). By default, `Last 2 days` and `Next 2 days` select two complete days before or after today. Set `includeTodayInQuickRanges` to `true` to add the complete current day to those ranges.
|
|
51
51
|
|
|
52
|
+
### Limiting the range length
|
|
53
|
+
|
|
54
|
+
Set `options.maxRange` to the longest range users may select, as a duration such as `{ months: 1 }`, `{ days: 30 }`, `{ weeks: 2 }` or `{ hours: 36 }`. The limit is measured from the start on the calendar, so `{ months: 1 }` allows Jan 15 → Feb 15.
|
|
55
|
+
|
|
56
|
+
- Quick options longer than the limit are hidden.
|
|
57
|
+
- In basic mode, once a start date is picked, days beyond the limit are disabled.
|
|
58
|
+
- Start and end times longer than the limit fail validation ("Range must not exceed 1 month").
|
|
59
|
+
- Around-a-time durations whose window exceeds the limit are not offered.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<TimezoneRangePicker
|
|
63
|
+
{...range}
|
|
64
|
+
onApply={handleTimeRangeApply}
|
|
65
|
+
options={{ maxRange: { months: 1 } }}
|
|
66
|
+
/>
|
|
67
|
+
```
|
|
68
|
+
|
|
52
69
|
---
|
|
53
70
|
|
|
54
71
|
## 📦 Installation
|
|
@@ -134,3 +151,16 @@ function App() {
|
|
|
134
151
|
);
|
|
135
152
|
}
|
|
136
153
|
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Releasing
|
|
158
|
+
|
|
159
|
+
Releases are published by the [Release workflow](https://github.com/GermaVinsmoke/react-timezone-range-picker/blob/main/.github/workflows/release.yml) when a new version reaches `main`:
|
|
160
|
+
|
|
161
|
+
1. Bump `version` in `packages/ui/package.json` in your pull request.
|
|
162
|
+
2. Merge it to `main`.
|
|
163
|
+
|
|
164
|
+
The workflow skips versions npm already has. For a new one it runs the tests, publishes the package to npm with provenance, then tags the commit `v<version>` and creates a GitHub Release with generated notes. If a run fails after publishing, re-running it only creates the missing tag and release.
|
|
165
|
+
|
|
166
|
+
npm authenticates the workflow through [trusted publishing](https://docs.npmjs.com/trusted-publishers), so no npm token is stored in the repository.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AroundTimePanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AroundTimePanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAe3B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxC,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,gBAAgB,CAiJzC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RangeDuration } from "../interfaces";
|
|
1
2
|
export declare enum TimeOption {
|
|
2
3
|
ThirtySeconds = "\u00B1 30 seconds",
|
|
3
4
|
OneMinute = "\u00B1 1 minute",
|
|
@@ -13,4 +14,5 @@ export declare const getStartEndDateTime: (date: string | null, time: string, ti
|
|
|
13
14
|
endDate: string | null;
|
|
14
15
|
endTime: string;
|
|
15
16
|
};
|
|
17
|
+
export declare const getAllowedTimeOptions: (maxRange?: RangeDuration) => TimeOption[];
|
|
16
18
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/AroundTimePanel/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/AroundTimePanel/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,oBAAY,UAAU;IACpB,aAAa,sBAAiB;IAC9B,SAAS,oBAAe;IACxB,cAAc,sBAAiB;IAC/B,aAAa,sBAAiB;IAC9B,OAAO,kBAAa;IACpB,MAAM,iBAAY;CACnB;AAED,eAAO,MAAM,YAAY,cAOxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,MAAM,EAAE,YAAY,UAAU;;;;;CAgE5F,CAAC;AAIF,eAAO,MAAM,qBAAqB,GAAI,WAAW,aAAa,iBAQ1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeOptions.d.ts","sourceRoot":"","sources":["../../src/RelativeTimePanel/timeOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAyGD,eAAO,MAAM,cAAc,GACzB,cAAc,MAAM,EACpB,UAAU,0BAA0B,KACnC,YAAY,
|
|
1
|
+
{"version":3,"file":"timeOptions.d.ts","sourceRoot":"","sources":["../../src/RelativeTimePanel/timeOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAyGD,eAAO,MAAM,cAAc,GACzB,cAAc,MAAM,EACpB,UAAU,0BAA0B,KACnC,YAAY,EAyBd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/StartEndTimePanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/StartEndTimePanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkB3B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,kBAAkB,CA+K7C,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicPickerView.d.ts","sourceRoot":"","sources":["../../src/TimezoneRangePicker/BasicPickerView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAIxC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAOD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"BasicPickerView.d.ts","sourceRoot":"","sources":["../../src/TimezoneRangePicker/BasicPickerView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAIxC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAOD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAoHpD,CAAC"}
|