@apexcura/ui-components 0.0.14-Beta287 → 0.0.14-Beta288
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 +11 -5
- package/dist/index.mjs +11 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -883,11 +883,13 @@ var DateRangePickerElement = (props) => {
|
|
|
883
883
|
const handleChange = (dates, dateStrings) => {
|
|
884
884
|
if (dates) {
|
|
885
885
|
let [start, end] = dates;
|
|
886
|
-
if (
|
|
886
|
+
if (start && start.isBefore(today)) {
|
|
887
887
|
end = today;
|
|
888
|
-
} else if (start &&
|
|
888
|
+
} else if (start && start.isAfter(today)) {
|
|
889
|
+
let temp;
|
|
890
|
+
start = temp;
|
|
889
891
|
start = today;
|
|
890
|
-
end =
|
|
892
|
+
end = temp;
|
|
891
893
|
}
|
|
892
894
|
const adjustedDates = [start, end].map((date) => date ? date.format("DD-MM-YYYY") : null);
|
|
893
895
|
props.onChange && props.onChange(adjustedDates);
|
|
@@ -917,9 +919,13 @@ var DateRangePickerElement = (props) => {
|
|
|
917
919
|
const handleCalendarChange = (dates) => {
|
|
918
920
|
if (dates) {
|
|
919
921
|
let [start, end] = dates;
|
|
920
|
-
if (start &&
|
|
922
|
+
if (start && start.isBefore(today)) {
|
|
923
|
+
end = today;
|
|
924
|
+
} else if (start && start.isAfter(today)) {
|
|
925
|
+
let temp;
|
|
926
|
+
start = temp;
|
|
921
927
|
start = today;
|
|
922
|
-
end =
|
|
928
|
+
end = temp;
|
|
923
929
|
}
|
|
924
930
|
const adjustedDates = [start, end];
|
|
925
931
|
props.onChange && props.onChange(adjustedDates);
|
package/dist/index.mjs
CHANGED
|
@@ -816,11 +816,13 @@ var DateRangePickerElement = (props) => {
|
|
|
816
816
|
const handleChange = (dates, dateStrings) => {
|
|
817
817
|
if (dates) {
|
|
818
818
|
let [start, end] = dates;
|
|
819
|
-
if (
|
|
819
|
+
if (start && start.isBefore(today)) {
|
|
820
820
|
end = today;
|
|
821
|
-
} else if (start &&
|
|
821
|
+
} else if (start && start.isAfter(today)) {
|
|
822
|
+
let temp;
|
|
823
|
+
start = temp;
|
|
822
824
|
start = today;
|
|
823
|
-
end =
|
|
825
|
+
end = temp;
|
|
824
826
|
}
|
|
825
827
|
const adjustedDates = [start, end].map((date) => date ? date.format("DD-MM-YYYY") : null);
|
|
826
828
|
props.onChange && props.onChange(adjustedDates);
|
|
@@ -850,9 +852,13 @@ var DateRangePickerElement = (props) => {
|
|
|
850
852
|
const handleCalendarChange = (dates) => {
|
|
851
853
|
if (dates) {
|
|
852
854
|
let [start, end] = dates;
|
|
853
|
-
if (start &&
|
|
855
|
+
if (start && start.isBefore(today)) {
|
|
856
|
+
end = today;
|
|
857
|
+
} else if (start && start.isAfter(today)) {
|
|
858
|
+
let temp;
|
|
859
|
+
start = temp;
|
|
854
860
|
start = today;
|
|
855
|
-
end =
|
|
861
|
+
end = temp;
|
|
856
862
|
}
|
|
857
863
|
const adjustedDates = [start, end];
|
|
858
864
|
props.onChange && props.onChange(adjustedDates);
|