[Vtigercrm-commits] [vtiger development] #4174: Bug in JavaScript Date validation

vtiger development vtiger-tickets at trac.vtiger.com
Fri Sep 14 02:23:33 EDT 2007


#4174: Bug in JavaScript Date validation
-----------------------+----------------------------------------------------
 Reporter:  libregeek  |       Owner:  developer
     Type:  defect     |      Status:  new      
 Priority:  critical   |   Milestone:  5.0.4    
Component:  vtigercrm  |     Version:  5.0.3    
 Keywords:             |  
-----------------------+----------------------------------------------------
 The JavaScript date validation in calendar module has a critical bug. The
 date validation function checks the entered date with the current date.
 But if the server and the client machines are having different timezones,
 the validation will fail. This is not the expected result. All the date
 validation should be synchronized with the server in which vtiger is
 installed. Using JavaScript for date validation is not a good idea. '''The
 ideal solution is to use AJAX for date validation'''. Here is the
 problematic code:
 File: modules/Calendar/script.js; line #600

 {{{

  if(document.EditView.eventstatus.value == "Planned")
                         {
                                 var currdate=new Date()
                                 var chkdate=new Date()
                 chkdate.setMinutes(event_startmin)
                 chkdate.setHours(event_starthour)
                                 chkdate.setYear(yyyy1)
                                 chkdate.setMonth(mm1-1)
                                 chkdate.setDate(dd1)

 if(!compareDates(chkdate,alert_arr.START_DATE_TIME,currdate,alert_arr.DATE_SHOULDNOT_PAST,"GE"))
                                 {
                                         getObj("date_start").focus();
                                         return false;
                                 }
                                 else return true
                         }

 }}}

-- 
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/4174>
vtiger development <http://trac.vtiger.com/>
vtigerCRM




More information about the vtigercrm-commits mailing list