Facebook Pixel

Get Weekday

React.js
easy
20 mins

Create a responsive Get Weekday component that displays the corresponding day of the week when a user selects or enters a valid date.

Requirements

  • A heading with text Get Weekday.
  • The interface must include:
    • An input field with a browser datepicker (type="date")
    • A button labeled "Find Day"
    • A display area that will show the resulting day of the week
  • Behavior on clicking the Find Day button:
    • If the date is valid:
      • Display the result in the format: "That date falls on Monday."

Edge Cases & Constraints

  • Dates from the past and future must work correctly
  • The datepicker must open when clicking the input
  • The displayed day must update immediately after clicking Find Day
  • Leap years and different time zones must not cause errors

Data Test IDs (Required for Testing):

  • data-testid="date-input" — Input field for selecting the date
  • data-testid="find-day-btn" — Button to trigger the day lookup
  • data-testid="result" — Display area for the resulting day of the week

Reference UI

getWeekday

Preview what you need to build

Companies:

oracle
shopify
amazon

Solve Similar questions 🔥

Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.