I am trying to set the minimum and maximum time in a date-time SharePoint field but i don't know what i am doing wrong.
I want the user to be able to select any date but the time in the date can be between 7 am and 9pm.
What i have tried so far:
fd.field('DateTime').widgetOptions = {
startTime: new Date(new Date().setHours(7,00,0)),
endTime: new Date(new Date().setHours(21, 0, 0))
}
//This give me only option of today. So definately not what i want
fd.field('DateTime').widgetOptions = {
min: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 7,00,0),
max: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 21,00,0)
}
Could you please advice me on this? Thanks in advance.