@apexcura/ui-components 0.0.14-Beta277 → 0.0.14-Beta278
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/dist/index.js +8 -2
- package/dist/index.mjs +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -878,14 +878,20 @@ var DateRangePickerElement = (props) => {
|
|
|
878
878
|
const { value } = props;
|
|
879
879
|
const { RangePicker } = import_antd15.DatePicker;
|
|
880
880
|
const dateValues = value ? value.map((date) => (0, import_dayjs2.default)(date, "DD-MM-YYYY")) : null;
|
|
881
|
+
const today = (0, import_dayjs2.default)();
|
|
881
882
|
const handleChange = (dates, dateStrings) => {
|
|
882
883
|
if (dates) {
|
|
883
|
-
|
|
884
|
+
if (props.weekrange) {
|
|
885
|
+
const updatedDates = [today, dates[1] || dates[0]];
|
|
886
|
+
const updatedDateStrings = updatedDates.map((date) => date && date.format("DD-MM-YYYY"));
|
|
887
|
+
props.onChange && props.onChange(updatedDateStrings);
|
|
888
|
+
} else {
|
|
889
|
+
props.onChange && props.onChange(dateStrings);
|
|
890
|
+
}
|
|
884
891
|
} else {
|
|
885
892
|
props.onChange && props.onChange("");
|
|
886
893
|
}
|
|
887
894
|
};
|
|
888
|
-
const today = (0, import_dayjs2.default)();
|
|
889
895
|
let rangePresets = [
|
|
890
896
|
{ label: "Last 7 Days", value: [(0, import_dayjs2.default)().subtract(6, "d"), today] },
|
|
891
897
|
{ label: "Last 14 Days", value: [(0, import_dayjs2.default)().subtract(13, "d"), today] },
|
package/dist/index.mjs
CHANGED
|
@@ -811,14 +811,20 @@ var DateRangePickerElement = (props) => {
|
|
|
811
811
|
const { value } = props;
|
|
812
812
|
const { RangePicker } = DatePicker2;
|
|
813
813
|
const dateValues = value ? value.map((date) => dayjs2(date, "DD-MM-YYYY")) : null;
|
|
814
|
+
const today = dayjs2();
|
|
814
815
|
const handleChange = (dates, dateStrings) => {
|
|
815
816
|
if (dates) {
|
|
816
|
-
|
|
817
|
+
if (props.weekrange) {
|
|
818
|
+
const updatedDates = [today, dates[1] || dates[0]];
|
|
819
|
+
const updatedDateStrings = updatedDates.map((date) => date && date.format("DD-MM-YYYY"));
|
|
820
|
+
props.onChange && props.onChange(updatedDateStrings);
|
|
821
|
+
} else {
|
|
822
|
+
props.onChange && props.onChange(dateStrings);
|
|
823
|
+
}
|
|
817
824
|
} else {
|
|
818
825
|
props.onChange && props.onChange("");
|
|
819
826
|
}
|
|
820
827
|
};
|
|
821
|
-
const today = dayjs2();
|
|
822
828
|
let rangePresets = [
|
|
823
829
|
{ label: "Last 7 Days", value: [dayjs2().subtract(6, "d"), today] },
|
|
824
830
|
{ label: "Last 14 Days", value: [dayjs2().subtract(13, "d"), today] },
|