@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.
@@ -139,12 +139,14 @@ function time2string(time) {
139
139
  }
140
140
  }
141
141
  function getDateText(date, t) {
142
- const unit = {
143
- d: t("common.day"),
144
- h: t("common.hour"),
145
- m: t("common.minute")
142
+ const count = date.value;
143
+ const dateString = {
144
+ d: t("common.day_count", { count }),
145
+ h: t("common.hour_count", { count }),
146
+ m: t("common.minute_count", { count }),
147
+ M: t("common.month_count", { count })
146
148
  }[date.unit];
147
- return `${t("components.past")} ${date.value} ${unit}`;
149
+ return `${t("components.past")} ${dateString}`;
148
150
  }
149
151
  function checkDateNotInRange(date, minDate, maxDate) {
150
152
  if (!minDate && !maxDate) {
@@ -45,7 +45,8 @@ const TimeRange = (props) => {
45
45
  onTypeChange,
46
46
  onRelativeTimeChange,
47
47
  onAbsoluteTimeOk,
48
- onAbsoluteTimeChange
48
+ onAbsoluteTimeChange,
49
+ relativeTimeSelectOptions
49
50
  } = props;
50
51
  const { t } = useParrotTranslation();
51
52
  const absoluteDateRef = useRef(null);
@@ -60,7 +61,8 @@ const TimeRange = (props) => {
60
61
  RelativeTime,
61
62
  {
62
63
  value: relativeTime,
63
- onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time)
64
+ onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
65
+ config: relativeTimeSelectOptions
64
66
  }
65
67
  ));
66
68
  } else if (mode === "absolute") {
@@ -84,7 +86,8 @@ const TimeRange = (props) => {
84
86
  RelativeTime,
85
87
  {
86
88
  value: relativeTime,
87
- onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time)
89
+ onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
90
+ config: relativeTimeSelectOptions
88
91
  }
89
92
  ))
90
93
  },
@@ -141,7 +144,8 @@ const DateRangePicker = (props) => {
141
144
  mode = ["relative", "absolute"],
142
145
  minDate,
143
146
  maxDate,
144
- onChange
147
+ onChange,
148
+ relativeTimeSelectOptions
145
149
  } = props;
146
150
  const { t } = useParrotTranslation();
147
151
  const [datePickerVisible, setDatePickerVisible] = useState(false);
@@ -281,7 +285,8 @@ const DateRangePicker = (props) => {
281
285
  onAbsoluteTimeChange: setRange,
282
286
  onAbsoluteTimeOk: (range2) => {
283
287
  handleChange("absolute", range2);
284
- }
288
+ },
289
+ relativeTimeSelectOptions
285
290
  }
286
291
  ),
287
292
  placement: "bottomLeft",