Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

Validate a datetimepicker

Hi experts
I need to validate a datetimepicker so that it cannot select a date greater than now or more than 1 year ago, any ideas how i can do this?.
0
dizzycat
Asked:
dizzycat
1 Solution
 
plusone3055Commented:
0
 
Éric MoreauSenior .Net ConsultantCommented:
why don't you set the MinDate and MaxDate properties of the control?
0
 
dizzycatAuthor Commented:
ok so now i can set the max date but how can i set the minimum date to date.now - 1 year, whether date.now is today next month or next year?
0
 
Éric MoreauSenior .Net ConsultantCommented:
yourdatefield.mindate = date.today.addyears(-1)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now