@apexcura/ui-components 0.0.14-Beta287 → 0.0.14-Beta289

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