Page 1 of 1

DateTime Picker min and max to restrict date selection

Posted: 06 Dec 2019
by Hnin Yu
Hello,

I would like to restrict date within 3 days(Include current days) using DateTime Field with custom in spform.User cannot be restrict the Next Day(Future Time).
Eg. Today is 6/12/2019.User can be select 4/12/2019 or 5/12/2019 or 6/12/2019 .But they cannot select and the next day or the previous of these days must be disable.
So,Please help me how can I do it ?

Re: DateTime Picker min and max to restrict date selection

Posted: 06 Dec 2019
by mnikitina
Hello Hnin Yu.

Please find the example of how to disable dates in the calendar in this post:
viewtopic.php?f=1&t=3151

Re: DateTime Picker min and max to restrict date selection

Posted: 09 Dec 2019
by Hnin Yu
Hello ,

Thanks.It is very help for me.But one thing let me know how can I readonly for this DateTime Picker(Kendo DateTime).I can select limited date but it can change it manually.So,I think it need to do readonly function in this DateTime Picker.

Re: DateTime Picker min and max to restrict date selection

Posted: 09 Dec 2019
by mnikitina
Hnin Yu,

Manual input will not be saved if it is not in the allowed range of dates.

But you can also disable the field itself with the following code:

Code: Select all

function disableDtae() {
  if (fd.field('Date').value()) {

    fd.field('Date').readonly(true);
  }
}

fd.field('Date').change(disableDtae);