@trackunit/react-date-and-time-components 1.13.19 → 1.13.21
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/index.cjs.js +11 -1
- package/index.esm.js +11 -1
- package/package.json +9 -9
- package/src/DayRangeSelect/types.d.ts +1 -1
- package/src/translation.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -25,6 +25,8 @@ var defaultTranslations = {
|
|
|
25
25
|
"input.today": "Today",
|
|
26
26
|
"input.unit.day": "day",
|
|
27
27
|
"input.unit.days": "days",
|
|
28
|
+
"input.unit.hour": "hour",
|
|
29
|
+
"input.unit.hours": "hours",
|
|
28
30
|
"input.unit.month": "month",
|
|
29
31
|
"input.unit.months": "months",
|
|
30
32
|
"input.unit.week": "week",
|
|
@@ -217,6 +219,10 @@ const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testi
|
|
|
217
219
|
const temporalArithmeticTypeMapping = {
|
|
218
220
|
day: "days",
|
|
219
221
|
days: "days",
|
|
222
|
+
hour: "hours",
|
|
223
|
+
hours: "hours",
|
|
224
|
+
month: "months",
|
|
225
|
+
months: "months",
|
|
220
226
|
};
|
|
221
227
|
|
|
222
228
|
/**
|
|
@@ -410,6 +416,10 @@ const useFindTemporalUnit = () => {
|
|
|
410
416
|
const temporalUnitsMap = react.useMemo(() => ({
|
|
411
417
|
day: t("input.unit.day"),
|
|
412
418
|
days: t("input.unit.days"),
|
|
419
|
+
hour: t("input.unit.hour"),
|
|
420
|
+
hours: t("input.unit.hours"),
|
|
421
|
+
month: t("input.unit.month"),
|
|
422
|
+
months: t("input.unit.months"),
|
|
413
423
|
}), [t]);
|
|
414
424
|
return react.useCallback((value) => {
|
|
415
425
|
if (!value) {
|
|
@@ -506,7 +516,7 @@ const formatCustomDateRangeLabel = (dateRange) => {
|
|
|
506
516
|
dateAndTimeUtils.formatDateUtil(dateRange.end ?? new Date(), { dateFormat: "medium", selectFormat: "dateOnly" }));
|
|
507
517
|
};
|
|
508
518
|
|
|
509
|
-
const TEMPORAL_UNITS = ["day", "days"];
|
|
519
|
+
const TEMPORAL_UNITS = ["day", "days", "hour", "hours", "month", "months"];
|
|
510
520
|
const TEMPORAL_DIRECTIONS = ["last", "next"];
|
|
511
521
|
/**
|
|
512
522
|
* Check if a value is a temporal period.
|
package/index.esm.js
CHANGED
|
@@ -23,6 +23,8 @@ var defaultTranslations = {
|
|
|
23
23
|
"input.today": "Today",
|
|
24
24
|
"input.unit.day": "day",
|
|
25
25
|
"input.unit.days": "days",
|
|
26
|
+
"input.unit.hour": "hour",
|
|
27
|
+
"input.unit.hours": "hours",
|
|
26
28
|
"input.unit.month": "month",
|
|
27
29
|
"input.unit.months": "months",
|
|
28
30
|
"input.unit.week": "week",
|
|
@@ -215,6 +217,10 @@ const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testi
|
|
|
215
217
|
const temporalArithmeticTypeMapping = {
|
|
216
218
|
day: "days",
|
|
217
219
|
days: "days",
|
|
220
|
+
hour: "hours",
|
|
221
|
+
hours: "hours",
|
|
222
|
+
month: "months",
|
|
223
|
+
months: "months",
|
|
218
224
|
};
|
|
219
225
|
|
|
220
226
|
/**
|
|
@@ -408,6 +414,10 @@ const useFindTemporalUnit = () => {
|
|
|
408
414
|
const temporalUnitsMap = useMemo(() => ({
|
|
409
415
|
day: t("input.unit.day"),
|
|
410
416
|
days: t("input.unit.days"),
|
|
417
|
+
hour: t("input.unit.hour"),
|
|
418
|
+
hours: t("input.unit.hours"),
|
|
419
|
+
month: t("input.unit.month"),
|
|
420
|
+
months: t("input.unit.months"),
|
|
411
421
|
}), [t]);
|
|
412
422
|
return useCallback((value) => {
|
|
413
423
|
if (!value) {
|
|
@@ -504,7 +514,7 @@ const formatCustomDateRangeLabel = (dateRange) => {
|
|
|
504
514
|
formatDateUtil(dateRange.end ?? new Date(), { dateFormat: "medium", selectFormat: "dateOnly" }));
|
|
505
515
|
};
|
|
506
516
|
|
|
507
|
-
const TEMPORAL_UNITS = ["day", "days"];
|
|
517
|
+
const TEMPORAL_UNITS = ["day", "days", "hour", "hours", "month", "months"];
|
|
508
518
|
const TEMPORAL_DIRECTIONS = ["last", "next"];
|
|
509
519
|
/**
|
|
510
520
|
* Check if a value is a temporal period.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-date-and-time-components",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.21",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/react-components": "1.14.
|
|
12
|
-
"@trackunit/date-and-time-utils": "1.10.
|
|
13
|
-
"@trackunit/react-date-and-time-hooks": "1.10.
|
|
14
|
-
"@trackunit/css-class-variance-utilities": "1.10.
|
|
15
|
-
"@trackunit/ui-icons": "1.10.
|
|
16
|
-
"@trackunit/shared-utils": "1.12.
|
|
17
|
-
"@trackunit/i18n-library-translation": "1.10.
|
|
18
|
-
"@trackunit/react-form-components": "1.11.
|
|
11
|
+
"@trackunit/react-components": "1.14.20",
|
|
12
|
+
"@trackunit/date-and-time-utils": "1.10.16",
|
|
13
|
+
"@trackunit/react-date-and-time-hooks": "1.10.21",
|
|
14
|
+
"@trackunit/css-class-variance-utilities": "1.10.16",
|
|
15
|
+
"@trackunit/ui-icons": "1.10.16",
|
|
16
|
+
"@trackunit/shared-utils": "1.12.16",
|
|
17
|
+
"@trackunit/i18n-library-translation": "1.10.17",
|
|
18
|
+
"@trackunit/react-form-components": "1.11.20",
|
|
19
19
|
"string-ts": "^2.0.0",
|
|
20
20
|
"tailwind-merge": "^2.0.0",
|
|
21
21
|
"react-calendar": "^6.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DateRange } from "@trackunit/date-and-time-utils";
|
|
2
2
|
import { TemporalArithmeticType, TemporalSameType } from "@trackunit/react-date-and-time-hooks";
|
|
3
|
-
export type TemporalUnit = Extract<TemporalArithmeticType | TemporalSameType, "day" | "days"
|
|
3
|
+
export type TemporalUnit = Extract<TemporalArithmeticType | TemporalSameType, "day" | "days"> | "hour" | "hours" | "month" | "months";
|
|
4
4
|
export type TemporalDirection = "next" | "last";
|
|
5
5
|
export type TemporalPeriod = {
|
|
6
6
|
direction: TemporalDirection;
|
package/src/translation.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare const translations: TranslationResource<TranslationKeys>;
|
|
|
14
14
|
/**
|
|
15
15
|
* Local useTranslation for this specific library
|
|
16
16
|
*/
|
|
17
|
-
export declare const useTranslation: () => [TransForLibs<"dateTime.instant.now" | "input.combined" | "input.direction.last" | "input.direction.next" | "input.icon.tooltip.calendar" | "input.noOptions" | "input.placeholder.customRange.last" | "input.placeholder.customRange.next" | "input.today" | "input.unit.day" | "input.unit.days" | "input.unit.month" | "input.unit.months" | "input.unit.week" | "input.unit.weeks" | "layout.actions.apply" | "layout.actions.back" | "layout.actions.cancel" | "layout.actions.clear" | "layout.actions.reset" | "shared.timePeriods.days" | "shared.timePeriods.days_plural" | "shared.timePeriods.hours" | "shared.timePeriods.hours_plural" | "shared.timePeriods.months" | "shared.timePeriods.months_plural" | "shared.timePeriods.today" | "shared.timePeriods.weeks" | "shared.timePeriods.weeks_plural" | "timeline.loadMore" | "trigger.customRange" | "trigger.selectDateRange">, import("i18next").i18n, boolean] & {
|
|
18
|
-
t: TransForLibs<"dateTime.instant.now" | "input.combined" | "input.direction.last" | "input.direction.next" | "input.icon.tooltip.calendar" | "input.noOptions" | "input.placeholder.customRange.last" | "input.placeholder.customRange.next" | "input.today" | "input.unit.day" | "input.unit.days" | "input.unit.month" | "input.unit.months" | "input.unit.week" | "input.unit.weeks" | "layout.actions.apply" | "layout.actions.back" | "layout.actions.cancel" | "layout.actions.clear" | "layout.actions.reset" | "shared.timePeriods.days" | "shared.timePeriods.days_plural" | "shared.timePeriods.hours" | "shared.timePeriods.hours_plural" | "shared.timePeriods.months" | "shared.timePeriods.months_plural" | "shared.timePeriods.today" | "shared.timePeriods.weeks" | "shared.timePeriods.weeks_plural" | "timeline.loadMore" | "trigger.customRange" | "trigger.selectDateRange">;
|
|
17
|
+
export declare const useTranslation: () => [TransForLibs<"dateTime.instant.now" | "input.combined" | "input.direction.last" | "input.direction.next" | "input.icon.tooltip.calendar" | "input.noOptions" | "input.placeholder.customRange.last" | "input.placeholder.customRange.next" | "input.today" | "input.unit.day" | "input.unit.days" | "input.unit.hour" | "input.unit.hours" | "input.unit.month" | "input.unit.months" | "input.unit.week" | "input.unit.weeks" | "layout.actions.apply" | "layout.actions.back" | "layout.actions.cancel" | "layout.actions.clear" | "layout.actions.reset" | "shared.timePeriods.days" | "shared.timePeriods.days_plural" | "shared.timePeriods.hours" | "shared.timePeriods.hours_plural" | "shared.timePeriods.months" | "shared.timePeriods.months_plural" | "shared.timePeriods.today" | "shared.timePeriods.weeks" | "shared.timePeriods.weeks_plural" | "timeline.loadMore" | "trigger.customRange" | "trigger.selectDateRange">, import("i18next").i18n, boolean] & {
|
|
18
|
+
t: TransForLibs<"dateTime.instant.now" | "input.combined" | "input.direction.last" | "input.direction.next" | "input.icon.tooltip.calendar" | "input.noOptions" | "input.placeholder.customRange.last" | "input.placeholder.customRange.next" | "input.today" | "input.unit.day" | "input.unit.days" | "input.unit.hour" | "input.unit.hours" | "input.unit.month" | "input.unit.months" | "input.unit.week" | "input.unit.weeks" | "layout.actions.apply" | "layout.actions.back" | "layout.actions.cancel" | "layout.actions.clear" | "layout.actions.reset" | "shared.timePeriods.days" | "shared.timePeriods.days_plural" | "shared.timePeriods.hours" | "shared.timePeriods.hours_plural" | "shared.timePeriods.months" | "shared.timePeriods.months_plural" | "shared.timePeriods.today" | "shared.timePeriods.weeks" | "shared.timePeriods.weeks_plural" | "timeline.loadMore" | "trigger.customRange" | "trigger.selectDateRange">;
|
|
19
19
|
i18n: import("i18next").i18n;
|
|
20
20
|
ready: boolean;
|
|
21
21
|
};
|