@mychoice/mychoice-sdk-modules 2.1.33 → 2.1.34

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/esm/index.js CHANGED
@@ -3255,8 +3255,13 @@ const StepsBox = ({ formSteps, validationHooks, propertyIsCompleted, }) => {
3255
3255
  const [showContent, setShowContent] = useState(false);
3256
3256
  useEffect(() => {
3257
3257
  const checkTime = () => {
3258
- const currentHour = new Date().getUTCHours() - 5; // EST is UTC-5
3259
- setShowContent(currentHour >= 9 && currentHour < 18);
3258
+ const currentUTCDate = new Date();
3259
+ const currentHour = currentUTCDate.getUTCHours() - 5; // EST is UTC-5
3260
+ const currentDay = currentUTCDate.getUTCDay(); // Sunday is 0, Monday is 1, ..., Saturday is 6
3261
+ // Check if it's a weekday (Monday to Friday) and if the current hour is between 9 am and 6 pm
3262
+ const isWeekday = currentDay >= 1 && currentDay <= 5;
3263
+ const isWorkingHours = currentHour >= 9 && currentHour < 18;
3264
+ setShowContent(isWeekday && isWorkingHours);
3260
3265
  };
3261
3266
  checkTime(); // Initial check
3262
3267
  const interval = setInterval(checkTime, 60000); // Check every minute
@@ -3981,8 +3986,13 @@ const AppRouteWrapper = (props) => {
3981
3986
  const [showContent, setShowContent] = useState(false);
3982
3987
  useEffect(() => {
3983
3988
  const checkTime = () => {
3984
- const currentHour = new Date().getUTCHours() - 5; // EST is UTC-5
3985
- setShowContent(currentHour >= 9 && currentHour < 18);
3989
+ const currentUTCDate = new Date();
3990
+ const currentHour = currentUTCDate.getUTCHours() - 5; // EST is UTC-5
3991
+ const currentDay = currentUTCDate.getUTCDay(); // Sunday is 0, Monday is 1, ..., Saturday is 6
3992
+ // Check if it's a weekday (Monday to Friday) and if the current hour is between 9 am and 6 pm
3993
+ const isWeekday = currentDay >= 1 && currentDay <= 5;
3994
+ const isWorkingHours = currentHour >= 9 && currentHour < 18;
3995
+ setShowContent(isWeekday && isWorkingHours);
3986
3996
  };
3987
3997
  checkTime(); // Initial check
3988
3998
  const interval = setInterval(checkTime, 60000); // Check every minute
@@ -4074,7 +4084,7 @@ const AppRouteWrapper = (props) => {
4074
4084
  window.removeEventListener('scroll', handleScroll);
4075
4085
  };
4076
4086
  }, []);
4077
- return (jsx(Fragment, { children: isReady && (jsxs(Fragment, { children: [jsx(AppHeader, {}), jsx(AppModal, {}), insuranceType && (jsx(Fragment, { children: jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted, id: "postalCodeData" }) })), showStickyBanner && showContent && isMobile && appType === AppTypes.MyChoice && (jsxs("div", { id: "stickyBanner", style: { position: "sticky", top: 0, color: "#FFFFFF", backgroundColor: "#8ED6DC", width: "100%", height: "75px", zIndex: 5000, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" }, children: [jsx("p", { style: { fontWeight: 700, fontSize: "22px" }, children: "Need Help? Give us a call at" }), jsx("a", { style: { marginTop: "5px" }, href: "tel:18884534644", children: "1-888-453-4644" })] })), insuranceType && appType === AppTypes.MyChoice && (jsx("div", { className: localIndex !== defaultLocalIndex ? 'step-progress-bar-partner' : 'step-progress-bar', children: jsx("span", { style: { width: progressLength } }) })), jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === AppTypes.MyChoice && isDesktop && progressLength ? (jsx(Fragment, { children: jsxs("div", { className: "mychoice-content", children: [jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsx("div", { className: "empty-steps-container" })] }) })) : children }), isMychoice && !appLoaderState.isOpen && jsx(ProviderImageFooter, {})] })) }));
4087
+ return (jsx(Fragment, { children: isReady && (jsxs(Fragment, { children: [jsx(AppHeader, {}), jsx(AppModal, {}), insuranceType && (jsx(Fragment, { children: jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted, id: "postalCodeData" }) })), showStickyBanner && showContent && isMobile && appType === AppTypes.MyChoice && (jsxs("div", { id: "stickyBanner", style: { position: "sticky", top: 0, color: "#FFFFFF", backgroundColor: "#8ED6DC", width: "100%", height: "75px", zIndex: 5000, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" }, children: [jsx("a", { style: { fontWeight: 700, fontSize: "22px" }, href: "tel:18884534644", children: "Need Help? Give us a call at" }), jsx("a", { style: { marginTop: "5px", textDecoration: "underline", fontWeight: 850 }, href: "tel:18884534644", children: "1-888-453-4644" })] })), insuranceType && appType === AppTypes.MyChoice && (jsx("div", { className: localIndex !== defaultLocalIndex ? 'step-progress-bar-partner' : 'step-progress-bar', children: jsx("span", { style: { width: progressLength } }) })), jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === AppTypes.MyChoice && isDesktop && progressLength ? (jsx(Fragment, { children: jsxs("div", { className: "mychoice-content", children: [jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsx("div", { className: "empty-steps-container" })] }) })) : children }), isMychoice && !appLoaderState.isOpen && jsx(ProviderImageFooter, {})] })) }));
4078
4088
  };
4079
4089
  const NestedRoutes = () => {
4080
4090
  const insuranceType = getInsuranceType();