How to show only current datetime in calendar control

Pritam Gupta asked on September 6, 2017 12:16

Hello,

I used Kentico's calendar control to select date time. here i get one issue i won't able to allow editor to select past datetime.

Please help me to solve this issue.

Thanks.

Recent Answers


Amit Srivastava answered on September 6, 2017 12:55 (last edited on September 6, 2017 13:17)

Just now, i checked and got it's allowing to select past date time. If you want to display current date by default then use ##TODAY## in Default value field and use below css in content before field of page type.

<style>
  .icon-only.btn-icon.btn{display: none;}
  .form-control.EditingFormCalendarTextBox{pointer-events: none;}
</style>
1 votesVote for this answer Mark as a Correct answer

Pritam Gupta answered on September 6, 2017 13:18

Hello Amit,

Thanks for your valuable reply Actually i dont't want to set default value and also i don't want to display Past date in Calendar.

0 votesVote for this answer Mark as a Correct answer

Suneel Jhangiani answered on September 6, 2017 17:01

The DateTimePicker should have a MinDate property for you to set.

If this is not available, then clone the Form Control and use your cloned version with MinDate and MaxDate properties.

Ref: http://devnet.kentico.com/docs/10_0/api/html/T_CMS_Base_Web_UI_DateTimePicker.htm

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.