Enable time in datapicker

Asked

Viewed 26 times

0

I am using boostrap-material-datetimepicker.js which as a result follows below: inserir a descrição da imagem aqui inserir a descrição da imagem aqui

The only problem is when I change the line below:

minDate: moment().endOf('day')

It also disables the time according to figure 2, but when I put:

minDate: null

I can select times, but in return, previous dates are also disabled.

How do I enable times but keep previous dates disabled?

  • There’s no contradiction there? Consigo selecionar os horários, mas em compensação, as datas anteriores também ficam desabilitadas.

Como faço para habilitar os horários, mas mantendo as datas anteriores desabilitadas?

1 answer

0

From what I understand you intend to make available the days and hours from the day, hours and minutes at the time, right?

If that’s it just use:

moment().milliseconds(0);

Using moment().endOf('day') returns the current date 23:59:59

  • Hello guys. I really don’t think I could express myself right. In the calendar, the user won’t be able to select the days before the current day. For that I put minDate: moment().endOf('day'), Only when I use this command, I end up disabling the schedules too and that’s not what I want. I need the schedules to be free to choose, regardless of the day and the days before the current day, to be disabled. I’m sorry I’m not being able to explain my problem in an understandable way.

  • Because I’m using it in sync with fullcalendar, which I disabled the days before the current day. The user then clicks on a given day, opens a modal with the fields: Title, Start Date, Start Time, End Date, End Time, Scheduling. The fields Start Date, Start Time, End Date and End Time I am using the datapicker according to the image. But if fullcalendar does not allow selecting the days prior to the current day, I would like the datapicker to have an option as well, without interfering with the selection of schedules. So the timing would be complete.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.