Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

53
Views
How to disable particular time slots in timepicker material UI

So i have a array of timeslots from which i want user to pick a time lets say

var arr = ["11:00:00","11:10:00","13:00:00"]

how can i disable other time slots from timepicker and only enable this time slots

My TimePicker

<TimePicker
      label="Time"
      value={value}
      onChange={handleChange}
      renderInput={(params) => <TextField {...params} />}
    />

Array of TimeSlots i want user to pick from

var timeSlots = [ "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", … ]

Actaully im getting this timeslots array from api

6 months ago · Santiago Trujillo
1 answers
Answer question

0

Hey Ronak you can use Filter() function of ES6 to get limited or particular timeslot. Try to use filter while fetching the timeSlot from API. If you still face any error just lemme know.

6 months ago · Santiago Trujillo Report
Answer question
Find remote jobs