@timardex/cluemart-shared 1.1.52 → 1.1.53
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/hooks/index.cjs +5 -3
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +5 -3
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -134,13 +134,13 @@ var formatDate = (dateStr, display = "datetime", timeStr) => {
|
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
var getCurrentAndFutureDates = (dates) => {
|
|
137
|
-
const
|
|
137
|
+
const now = dayjs();
|
|
138
138
|
return dates.filter((dateObj) => {
|
|
139
139
|
const dateTime = dayjs(
|
|
140
140
|
`${dateObj.startDate} ${dateObj.startTime}`,
|
|
141
141
|
`${dateFormat} ${timeFormat}`
|
|
142
142
|
);
|
|
143
|
-
return dateTime.isSameOrAfter(
|
|
143
|
+
return dateTime.isSameOrAfter(now);
|
|
144
144
|
});
|
|
145
145
|
};
|
|
146
146
|
var isFutureDatesBeforeThreshold = (date2, minHoursFromNow) => {
|
|
@@ -4179,11 +4179,12 @@ var noLeadingZeros = (fieldName, options = {}) => {
|
|
|
4179
4179
|
};
|
|
4180
4180
|
dayjs2.extend(isSameOrAfter2);
|
|
4181
4181
|
dayjs2.extend(customParseFormat2);
|
|
4182
|
-
var now = dayjs2();
|
|
4183
4182
|
var endDateNotInPastTest = yup.string().test("not-in-past", "End date cannot be in the past", (value) => {
|
|
4183
|
+
const now = dayjs2();
|
|
4184
4184
|
return value ? dayjs2(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
4185
4185
|
});
|
|
4186
4186
|
var startDateNotInPastTest = yup.string().test("not-in-past", "Start date cannot be in the past", (value) => {
|
|
4187
|
+
const now = dayjs2();
|
|
4187
4188
|
return value ? dayjs2(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
4188
4189
|
});
|
|
4189
4190
|
var endDateAfterStartDateTest = yup.string().test(
|
|
@@ -4221,6 +4222,7 @@ var startTimeCannotBeInPastTest = yup.string().test(
|
|
|
4221
4222
|
"valid-start-time",
|
|
4222
4223
|
"Start time cannot be in the past",
|
|
4223
4224
|
function(value) {
|
|
4225
|
+
const now = dayjs2();
|
|
4224
4226
|
const { startDate } = this.parent;
|
|
4225
4227
|
if (!startDate || !value) return false;
|
|
4226
4228
|
const startDateTime = dayjs2(
|
|
@@ -4534,8 +4536,8 @@ var adSchema = yup7.object().shape({
|
|
|
4534
4536
|
end: yup7.date().required("End date is required").test("is-future-date", "End date must be in the future", (value) => {
|
|
4535
4537
|
if (!value) return false;
|
|
4536
4538
|
const endDate = new Date(value);
|
|
4537
|
-
const
|
|
4538
|
-
return endDate >
|
|
4539
|
+
const now = /* @__PURE__ */ new Date();
|
|
4540
|
+
return endDate > now;
|
|
4539
4541
|
}).when("start", {
|
|
4540
4542
|
is: (val) => val && val.length > 0,
|
|
4541
4543
|
then: (schema) => schema.test(
|