Ignore:
Timestamp:
02/14/12 09:21:16 (12 years ago)
Author:
fernando
Message:

Ticket #2434 - Calendário diario e semanal exibido a partir da hora inicial padrão

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        11nbproject 
        2  
        32header.inc.php 
         3._header.inc.php 
  • trunk/prototype/modules/calendar/js

    • Property svn:ignore set to
      ._helpers.js
      ._init.js
      ._calendar.date.js
  • trunk/prototype/modules/calendar/js/calendar.date.js

    r5437 r5510  
    102102                        Hour += (Hour.length == 5) ? " pm" : ""; 
    103103                }else 
    104                         Hour = "0"+(HourAmPm[0]-12)+":"+HourAmPm[1]+ ((Hour.length == 5) ? " pm" : ""); 
     104                        Hour = (((HourAmPm[0]-12)>=10) ? "" : "0") +(HourAmPm[0]-12)+":"+HourAmPm[1]+ ((Hour.length == 5) ? " pm" : ""); 
    105105                return Hour; 
     106        }, 
     107         
     108        AmPmTo24 : function (Hour) 
     109        { 
     110                var Hour24h = Hour.trim(); 
     111                var AmPm; 
     112                if (Hour24h.length == 0) return; 
     113                if (Hour24h.length > 5) { 
     114                  AmPm = Hour24h.slice(-2); 
     115                  Hour24h = Hour24h.substring(0,5); 
     116                } 
     117                 
     118                var Hour24h = Hour24h.split(":"); 
     119                 
     120                if (Hour24h[0] == 12) 
     121                  Hour24h[0] = "00"; 
     122 
     123                if (AmPm === "pm") { 
     124                  Hour24h[0] = parseInt(Hour24h[0]) + 12; 
     125                }  
     126                 
     127                return Hour24h[0] + ":" + Hour24h[1]; 
     128        }, 
     129         
     130    // 01:00 retorna 1, 10:00 retorna 10, 22:00 retorna 10 
     131    getShortestTime : function(Hour) { 
     132                var _hour = this.defaultToAmPm(Hour); 
     133                if (_hour[0] == 0) 
     134                  _hour = _hour[1]; 
     135                else 
     136                  _hour = _hour.substring(0,2); 
     137                 
     138                return _hour; 
    106139        }, 
    107140         
Note: See TracChangeset for help on using the changeset viewer.