@cloudtower/eagle 0.32.26 → 0.32.28

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.
@@ -145,12 +145,14 @@ function time2string(time) {
145
145
  }
146
146
  }
147
147
  function getDateText(date, t) {
148
- const unit = {
149
- d: t("common.day"),
150
- h: t("common.hour"),
151
- m: t("common.minute")
148
+ const count = date.value;
149
+ const dateString = {
150
+ d: t("common.day_count", { count }),
151
+ h: t("common.hour_count", { count }),
152
+ m: t("common.minute_count", { count }),
153
+ M: t("common.month_count", { count })
152
154
  }[date.unit];
153
- return `${t("components.past")} ${date.value} ${unit}`;
155
+ return `${t("components.past")} ${dateString}`;
154
156
  }
155
157
  function checkDateNotInRange(date, minDate, maxDate) {
156
158
  if (!minDate && !maxDate) {
@@ -54,7 +54,8 @@ const TimeRange = (props) => {
54
54
  onTypeChange,
55
55
  onRelativeTimeChange,
56
56
  onAbsoluteTimeOk,
57
- onAbsoluteTimeChange
57
+ onAbsoluteTimeChange,
58
+ relativeTimeSelectOptions
58
59
  } = props;
59
60
  const { t } = useParrotTranslation();
60
61
  const absoluteDateRef = React.useRef(null);
@@ -69,7 +70,8 @@ const TimeRange = (props) => {
69
70
  RelativeTime,
70
71
  {
71
72
  value: relativeTime,
72
- onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time)
73
+ onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
74
+ config: relativeTimeSelectOptions
73
75
  }
74
76
  ));
75
77
  } else if (mode === "absolute") {
@@ -93,7 +95,8 @@ const TimeRange = (props) => {
93
95
  RelativeTime,
94
96
  {
95
97
  value: relativeTime,
96
- onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time)
98
+ onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
99
+ config: relativeTimeSelectOptions
97
100
  }
98
101
  ))
99
102
  },
@@ -150,7 +153,8 @@ const DateRangePicker = (props) => {
150
153
  mode = ["relative", "absolute"],
151
154
  minDate,
152
155
  maxDate,
153
- onChange
156
+ onChange,
157
+ relativeTimeSelectOptions
154
158
  } = props;
155
159
  const { t } = useParrotTranslation();
156
160
  const [datePickerVisible, setDatePickerVisible] = React.useState(false);
@@ -290,7 +294,8 @@ const DateRangePicker = (props) => {
290
294
  onAbsoluteTimeChange: setRange,
291
295
  onAbsoluteTimeOk: (range2) => {
292
296
  handleChange("absolute", range2);
293
- }
297
+ },
298
+ relativeTimeSelectOptions
294
299
  }
295
300
  ),
296
301
  placement: "bottomLeft",