@apexcura/ui-components 0.0.15-Beta38 → 0.0.15-Beta39
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 +31 -0
- package/dist/index.mjs +31 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -853,9 +853,40 @@ var DatePickerElement = (props) => {
|
|
|
853
853
|
}
|
|
854
854
|
return current && current > (0, import_dayjs.default)().endOf("day");
|
|
855
855
|
};
|
|
856
|
+
const disabledTime = (date) => {
|
|
857
|
+
if (!date) return {};
|
|
858
|
+
if (props.enabled_dates === "from_today" && date.isSame((0, import_dayjs.default)(), "day")) {
|
|
859
|
+
const currentHour = (0, import_dayjs.default)().hour();
|
|
860
|
+
const currentMinute = (0, import_dayjs.default)().minute();
|
|
861
|
+
return {
|
|
862
|
+
disabledHours: () => [...Array(24).keys()].slice(0, currentHour),
|
|
863
|
+
disabledMinutes: (hour) => {
|
|
864
|
+
if (hour === currentHour) {
|
|
865
|
+
return [...Array(60).keys()].slice(0, currentMinute + 1);
|
|
866
|
+
}
|
|
867
|
+
return [];
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
if ((props.enabled_dates === "till_today" || !props.enabled_dates) && date.isSame((0, import_dayjs.default)(), "day")) {
|
|
872
|
+
const currentHour = (0, import_dayjs.default)().hour();
|
|
873
|
+
const currentMinute = (0, import_dayjs.default)().minute();
|
|
874
|
+
return {
|
|
875
|
+
disabledHours: () => [...Array(24).keys()].slice(currentHour + 1, 24),
|
|
876
|
+
disabledMinutes: (hour) => {
|
|
877
|
+
if (hour === currentHour) {
|
|
878
|
+
return [...Array(60).keys()].slice(currentMinute + 1, 60);
|
|
879
|
+
}
|
|
880
|
+
return [];
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
return {};
|
|
885
|
+
};
|
|
856
886
|
return /* @__PURE__ */ import_react20.default.createElement("div", null, /* @__PURE__ */ import_react20.default.createElement(
|
|
857
887
|
import_antd14.DatePicker,
|
|
858
888
|
{
|
|
889
|
+
disabledTime,
|
|
859
890
|
disabledDate,
|
|
860
891
|
placeholder: props.placeholder,
|
|
861
892
|
value: dateState,
|
package/dist/index.mjs
CHANGED
|
@@ -784,9 +784,40 @@ var DatePickerElement = (props) => {
|
|
|
784
784
|
}
|
|
785
785
|
return current && current > dayjs().endOf("day");
|
|
786
786
|
};
|
|
787
|
+
const disabledTime = (date) => {
|
|
788
|
+
if (!date) return {};
|
|
789
|
+
if (props.enabled_dates === "from_today" && date.isSame(dayjs(), "day")) {
|
|
790
|
+
const currentHour = dayjs().hour();
|
|
791
|
+
const currentMinute = dayjs().minute();
|
|
792
|
+
return {
|
|
793
|
+
disabledHours: () => [...Array(24).keys()].slice(0, currentHour),
|
|
794
|
+
disabledMinutes: (hour) => {
|
|
795
|
+
if (hour === currentHour) {
|
|
796
|
+
return [...Array(60).keys()].slice(0, currentMinute + 1);
|
|
797
|
+
}
|
|
798
|
+
return [];
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
if ((props.enabled_dates === "till_today" || !props.enabled_dates) && date.isSame(dayjs(), "day")) {
|
|
803
|
+
const currentHour = dayjs().hour();
|
|
804
|
+
const currentMinute = dayjs().minute();
|
|
805
|
+
return {
|
|
806
|
+
disabledHours: () => [...Array(24).keys()].slice(currentHour + 1, 24),
|
|
807
|
+
disabledMinutes: (hour) => {
|
|
808
|
+
if (hour === currentHour) {
|
|
809
|
+
return [...Array(60).keys()].slice(currentMinute + 1, 60);
|
|
810
|
+
}
|
|
811
|
+
return [];
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
return {};
|
|
816
|
+
};
|
|
787
817
|
return /* @__PURE__ */ React20.createElement("div", null, /* @__PURE__ */ React20.createElement(
|
|
788
818
|
DatePicker,
|
|
789
819
|
{
|
|
820
|
+
disabledTime,
|
|
790
821
|
disabledDate,
|
|
791
822
|
placeholder: props.placeholder,
|
|
792
823
|
value: dateState,
|