This is a migrated thread and some comments may be shown as answers.

DateTimePicker doubt

2 Answers 44 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Marta
Top achievements
Rank 1
Marta asked on 06 Jul 2009, 03:20 PM
Hi.

I am creating a website where a user creates a piece of content, and when he submits it, he chooses when he wants it to be published. For this, I am using the DateTimePicker, which works fine, but I would like to make it so that the user can't select dates or times which have already passed, as it is what makes sense in this example. How can I do this?
Also, when I query my database to show the contents which have been published, I also want to compare the publish date with the date of today to know if I should show that content or not.

Any ideas?
Thanks,

Marta

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 06 Jul 2009, 03:56 PM
Hi Marta,

You can set MinDate programmatically to the RadDateTimePicker, so that the control does not allow selecting earlier dates than the current date.

As for your second question, it does not seem to be related to the RadDateTimePicker control.

All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Marta
Top achievements
Rank 1
answered on 06 Jul 2009, 04:29 PM

Thanks.

I ended up using

 

RadDateTimePicker.MinDate =

DateTime.Now;

 


so that I could limit the min date and time to the current ones.

Marta
Tags
Calendar
Asked by
Marta
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Marta
Top achievements
Rank 1
Share this question
or