IO-3040 Report Selector Date Range Restriction for Prod

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
Allan Carr
2024-11-27 16:24:10 -08:00
parent 0770e7b50d
commit fd9e7b4d4b

View File

@@ -283,7 +283,12 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
},
{
validator: (_, value) => {
if (value && value[0] && value[1] && process.env.NODE_ENV === "production") {
if (
(!import.meta.env.VITE_APP_IS_TEST && import.meta.env.PROD) &&
value &&
value[0] &&
value[1]
) {
const diffInDays = (value[1] - value[0]) / (1000 * 3600 * 24);
if (diffInDays > 92) {
return Promise.reject(t("general.validation.dateRangeExceeded"));