PDA

View Full Version : two datepicker



wehtam
20 Sep 2007, 7:58 AM
Hello,
I would like to have two datepicker. but I would like that the date clicked in my first calendar is always lower than date of my second calendar.
How to make?
Thank you
ps : have you an example ?

jimmyphp
20 Sep 2007, 10:40 AM
create a Vtype custome rule:



Ext.form.VTypes.testDate = function(v, field){
datauno = Ext.get(field.relatedField).getValue();
var dateuno = Date.parseDate(datauno, 'd/m/Y');
var datedue = Date.parseDate(v, 'd/m/Y');
return datedue > dateuno;
}
Ext.form.VTypes.testDateText = "La data finale deve essere superiore alla data iniziale.";


date field:



relatedField = datauno,
vtype = testDate