Changeset 6606 for branches/2.4


Ignore:
Timestamp:
06/25/12 12:15:22 (12 years ago)
Author:
eduardow
Message:

Ticket #2875 - Correção na mensagem quando a data inicial for maior que a final.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/prototype/modules/calendar/js/helpers.js

    r6584 r6606  
    2424              
    2525            'equalData' : 'Hora inicial igual a final',  
    26             'theirData' : 'Hora final menor que a inicial',  
     26            'theirData' : 'Data final menor que a inicial',           
     27            'theirHour' : 'Hora final menor que a inicial',  
    2728              
    2829            'emptyOcurrence' : 'Por favor, informe o número de ocorrências',  
     
    6768                        return errors['theirData'];  
    6869        }else{  
    69                 var conditon = endDate.compareTo(startDate);  
    70                 if(conditon != 1)   
    71                         return errors[conditon == 0 ? 'equalData' : 'theirData'];  
    72         }  
     70                var condition = endDate.compareTo(startDate);  
     71                                if(condition != 1){  
     72                                        if(condition < 0){  
     73                                                startDate.clearTime();  
     74                                                endDate.clearTime();  
     75                                                condition = endDate.compareTo(startDate);                                 
     76                                                return (errors[ condition == 0 ? 'theirHour' : 'theirData'] );  
     77                                        }  
     78                                        else  
     79                                                return errors['equalData'];  
     80                                } 
     81        } 
    7382     
    7483   if (customDate)      
Note: See TracChangeset for help on using the changeset viewer.