Skip to content

fix(react): hide calendar when operatingHours is undefined#1311

Open
nlaverde-godaddy wants to merge 1 commit intogodaddy:mainfrom
nlaverde-godaddy:vnext-75883
Open

fix(react): hide calendar when operatingHours is undefined#1311
nlaverde-godaddy wants to merge 1 commit intogodaddy:mainfrom
nlaverde-godaddy:vnext-75883

Conversation

@nlaverde-godaddy
Copy link

Summary

Fixes a bug where the pickup date/time calendar was incorrectly displaying when a merchant has no operatingHours configured.

Problem

The condition storeHours?.pickupWindowInDays !== 0 evaluates to true when storeHours is undefined, because undefined !== 0 is true. This caused the calendar and time picker to show even when the merchant had no operating hours set up.

Solution

Changed the condition to storeHours && storeHours.pickupWindowInDays !== 0 in three places:

  • Line 589: Date picker visibility
  • Line 682: Time picker visibility
  • Line 731: "No time slots" warning visibility

Changeset

  • Changeset added (docs)

Test Plan

  • Added unit tests covering all scenarios for the visibility logic
  • All tests passing ✅
  • Mock data and see all it's working

before =>

After =>
Screenshot 2026-03-03 at 17 58 11

@nlaverde-godaddy nlaverde-godaddy requested a review from a team as a code owner March 4, 2026 15:57
@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 72641e8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants