Changeset 6552 for trunk


Ignore:
Timestamp:
06/20/12 12:27:20 (12 years ago)
Author:
douglasz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/js/helpers.js

    r6498 r6552  
    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']; 
     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                } 
    7281        } 
    7382     
Note: See TracChangeset for help on using the changeset viewer.