@timardex/cluemart-shared 2.1.8 → 2.2.0

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.
@@ -274,10 +274,26 @@ var startTimeCannotBeInPastTest = yup.string().test(
274
274
  );
275
275
  var dateTimeSchema = yup.object().shape({
276
276
  dateStatus: yup.mixed().oneOf(Object.values(EnumEventDateStatus)).required("Date status is required"),
277
- endDate: yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
278
- endTime: yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
279
- startDate: yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
280
- startTime: yup.string().label("Start Time").concat(startTimeCannotBeInPastTest).required("Start time is required")
277
+ endDate: yup.string().label("End Date").defined().when("dateStatus", {
278
+ is: (status) => status !== "Canceled" /* CANCELED */,
279
+ then: () => yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
280
+ otherwise: () => yup.string().label("End Date").defined()
281
+ }),
282
+ endTime: yup.string().label("End Time").defined().when("dateStatus", {
283
+ is: (status) => status !== "Canceled" /* CANCELED */,
284
+ then: () => yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
285
+ otherwise: () => yup.string().label("End Time").defined()
286
+ }),
287
+ startDate: yup.string().label("Start Date").defined().when("dateStatus", {
288
+ is: (status) => status !== "Canceled" /* CANCELED */,
289
+ then: () => yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
290
+ otherwise: () => yup.string().label("Start Date").defined()
291
+ }),
292
+ startTime: yup.string().label("Start Time").defined().when("dateStatus", {
293
+ is: (status) => status !== "Canceled" /* CANCELED */,
294
+ then: () => yup.string().label("Start Time").concat(startTimeCannotBeInPastTest).required("Start time is required"),
295
+ otherwise: () => yup.string().label("Start Time").defined()
296
+ })
281
297
  });
282
298
  var stallTypesSchema = yup.object({
283
299
  label: yup.string().trim().label("Stall Type").required("Stall type is required"),