'How to add random minutes like first slots should be 30 minutes and then 1 of 15 minute slot and again 30 minute slot
const eventClick = (args) => {
let StartTime = moment(args?.event?.StartTime, 'HH:mm ')
let EndTime = moment(args?.event?.EndTime, 'HH:mm ')
if (EndTime.isBefore(StartTime)) {
EndTime.add(1, 'day')
}
let arr = []
while (StartTime <= EndTime) {
arr.push(new moment(StartTime).format('HH:mm'))
StartTime.add(30, 'minutes')
}
setSlotEvent(arr)
setOpen(true)
setCellEvent(args.event)
}
{
slotEvent && slotEvent?.map((data, index) => (
<>
<div className='slotGrid'>
{data}
</div>
</>
))
}
How to add random minutes like first slots should be 30 minutes and then 1 of 15 minute slot and again 30 minute slot
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
