@timardex/cluemart-shared 2.1.9 → 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.
@@ -1906,10 +1906,26 @@ var startTimeCannotBeInPastTest = yup.string().test(
1906
1906
  );
1907
1907
  var dateTimeSchema = yup.object().shape({
1908
1908
  dateStatus: yup.mixed().oneOf(Object.values(EnumEventDateStatus)).required("Date status is required"),
1909
- endDate: yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
1910
- endTime: yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
1911
- startDate: yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
1912
- startTime: yup.string().label("Start Time").concat(startTimeCannotBeInPastTest).required("Start time is required")
1909
+ endDate: yup.string().label("End Date").defined().when("dateStatus", {
1910
+ is: (status) => status !== "Canceled" /* CANCELED */,
1911
+ then: () => yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
1912
+ otherwise: () => yup.string().label("End Date").defined()
1913
+ }),
1914
+ endTime: yup.string().label("End Time").defined().when("dateStatus", {
1915
+ is: (status) => status !== "Canceled" /* CANCELED */,
1916
+ then: () => yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
1917
+ otherwise: () => yup.string().label("End Time").defined()
1918
+ }),
1919
+ startDate: yup.string().label("Start Date").defined().when("dateStatus", {
1920
+ is: (status) => status !== "Canceled" /* CANCELED */,
1921
+ then: () => yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
1922
+ otherwise: () => yup.string().label("Start Date").defined()
1923
+ }),
1924
+ startTime: yup.string().label("Start Time").defined().when("dateStatus", {
1925
+ is: (status) => status !== "Canceled" /* CANCELED */,
1926
+ then: () => yup.string().label("Start Time").concat(startTimeCannotBeInPastTest).required("Start time is required"),
1927
+ otherwise: () => yup.string().label("Start Time").defined()
1928
+ })
1913
1929
  });
1914
1930
  var stallTypesSchema = yup.object({
1915
1931
  label: yup.string().trim().label("Stall Type").required("Stall type is required"),