JQuery function or functions for dates -
i building custom user control in asp.net user can enter in date. using jquery function puts in date mask in format of dd/mm/yyyy, unable find jquery function(s) or 1 combines needs.
what looking is:
1) validate whether date date, i.e. not 31/13/2010 or along lines.
2) can check see whether date in past or in future based upon configuration entry in application.
can me, please?
this off top of head, use javascript's date
object http://www.w3schools.com/jsref/jsref_obj_date.asp
1) use 1 of following
var d = new date(datestring); var d = new date(year, month, day, hours, minutes, seconds, milliseconds);
then verify date components same entered. if set month 50, take year, , go 50 months forward... seems odd, but... have verify information entered. months start @ 0 january, when checking, aware of that.
2) there's lot of ways check, quick thought on is
var t = d.gettime() - new date().gettime();
if t positive, it's in future, if it's negative it's in past. new date()
creates date object current time.
you use jquery ui datepicker. http://jqueryui.com/demos/datepicker/ haven't checking exact functionality has might fit requirement, resource check into.
hth
Comments
Post a Comment