@apexcura/ui-components 0.0.15-Beta52 → 0.0.15-Beta53
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 +24 -23
- package/dist/index.mjs +24 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -861,31 +861,32 @@ var DatePickerElement = (props) => {
|
|
|
861
861
|
};
|
|
862
862
|
const disabledTime = (date) => {
|
|
863
863
|
if (!date) return {};
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
864
|
+
const currentHour = (0, import_dayjs.default)().hour();
|
|
865
|
+
const currentMinute = (0, import_dayjs.default)().minute();
|
|
866
|
+
if (props.enabled_dates === "from_today") {
|
|
867
|
+
if (date.isSame((0, import_dayjs.default)(), "day")) {
|
|
868
|
+
return {
|
|
869
|
+
disabledHours: () => [...Array(24).keys()].slice(0, currentHour),
|
|
870
|
+
disabledMinutes: (hour) => {
|
|
871
|
+
if (hour === currentHour) {
|
|
872
|
+
return [...Array(60).keys()].slice(0, currentMinute + 1);
|
|
873
|
+
}
|
|
874
|
+
return [];
|
|
872
875
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
return [...Array(60).keys()].slice(currentMinute + 1, 60);
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
} else if (props.enabled_dates === "till_today" || !props.enabled_dates) {
|
|
879
|
+
if (date.isSame((0, import_dayjs.default)(), "day")) {
|
|
880
|
+
return {
|
|
881
|
+
disabledHours: () => [...Array(24).keys()].slice(currentHour + 1, 24),
|
|
882
|
+
disabledMinutes: (hour) => {
|
|
883
|
+
if (hour === currentHour) {
|
|
884
|
+
return [...Array(60).keys()].slice(currentMinute + 1, 60);
|
|
885
|
+
}
|
|
886
|
+
return [];
|
|
885
887
|
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
};
|
|
888
|
+
};
|
|
889
|
+
}
|
|
889
890
|
}
|
|
890
891
|
return {};
|
|
891
892
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -792,31 +792,32 @@ var DatePickerElement = (props) => {
|
|
|
792
792
|
};
|
|
793
793
|
const disabledTime = (date) => {
|
|
794
794
|
if (!date) return {};
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
795
|
+
const currentHour = dayjs().hour();
|
|
796
|
+
const currentMinute = dayjs().minute();
|
|
797
|
+
if (props.enabled_dates === "from_today") {
|
|
798
|
+
if (date.isSame(dayjs(), "day")) {
|
|
799
|
+
return {
|
|
800
|
+
disabledHours: () => [...Array(24).keys()].slice(0, currentHour),
|
|
801
|
+
disabledMinutes: (hour) => {
|
|
802
|
+
if (hour === currentHour) {
|
|
803
|
+
return [...Array(60).keys()].slice(0, currentMinute + 1);
|
|
804
|
+
}
|
|
805
|
+
return [];
|
|
803
806
|
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
return [...Array(60).keys()].slice(currentMinute + 1, 60);
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
} else if (props.enabled_dates === "till_today" || !props.enabled_dates) {
|
|
810
|
+
if (date.isSame(dayjs(), "day")) {
|
|
811
|
+
return {
|
|
812
|
+
disabledHours: () => [...Array(24).keys()].slice(currentHour + 1, 24),
|
|
813
|
+
disabledMinutes: (hour) => {
|
|
814
|
+
if (hour === currentHour) {
|
|
815
|
+
return [...Array(60).keys()].slice(currentMinute + 1, 60);
|
|
816
|
+
}
|
|
817
|
+
return [];
|
|
816
818
|
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
};
|
|
819
|
+
};
|
|
820
|
+
}
|
|
820
821
|
}
|
|
821
822
|
return {};
|
|
822
823
|
};
|