[7029] | 1 | dateCalendar = { |
---|
| 2 | //sortMonthOfNumber |
---|
| 3 | monthNamesShort: |
---|
| 4 | [ |
---|
| 5 | 'Jan', |
---|
| 6 | 'Fev', |
---|
| 7 | 'Mar', |
---|
| 8 | 'Abr', |
---|
| 9 | 'Mai', |
---|
| 10 | 'Jun', |
---|
| 11 | 'Jul', |
---|
| 12 | 'Ago', |
---|
| 13 | 'Set', |
---|
| 14 | 'Out', |
---|
| 15 | 'Nov', |
---|
| 16 | 'Dez' |
---|
| 17 | ], |
---|
| 18 | |
---|
| 19 | //MonthOfNumber |
---|
| 20 | monthNames: |
---|
| 21 | [ |
---|
| 22 | 'Janeiro', |
---|
| 23 | 'Fevereiro', |
---|
| 24 | 'Março', |
---|
| 25 | 'Abril', |
---|
| 26 | 'Maio', |
---|
| 27 | 'Junho', |
---|
| 28 | 'Julho', |
---|
| 29 | 'Agosto', |
---|
| 30 | 'Setembro', |
---|
| 31 | 'Outubro', |
---|
| 32 | 'Novembro', |
---|
| 33 | 'Dezembro' |
---|
| 34 | ], |
---|
| 35 | |
---|
| 36 | //weekOfDay |
---|
| 37 | dayNames: |
---|
| 38 | [ |
---|
| 39 | 'Domingo', |
---|
| 40 | 'Segunda', |
---|
| 41 | 'Terça', |
---|
| 42 | 'Quarta', |
---|
| 43 | 'Quinta', |
---|
| 44 | 'Sexta', |
---|
| 45 | 'Sábado' |
---|
| 46 | ], |
---|
| 47 | |
---|
| 48 | dayOfWeek: |
---|
| 49 | { |
---|
| 50 | 'SUN': 0, |
---|
| 51 | 'MON': 1, |
---|
| 52 | 'TUE': 2, |
---|
| 53 | 'WED': 3, |
---|
| 54 | 'THU': 4, |
---|
| 55 | 'FRI': 5, |
---|
| 56 | 'SAT': 6 |
---|
| 57 | }, |
---|
| 58 | |
---|
| 59 | dayNamesShort: |
---|
| 60 | [ |
---|
| 61 | 'Dom', |
---|
| 62 | 'Seg', |
---|
| 63 | 'Ter', |
---|
| 64 | 'Qua', |
---|
| 65 | 'Qui', |
---|
| 66 | 'Sex', |
---|
| 67 | 'Sab' |
---|
| 68 | ], |
---|
| 69 | |
---|
| 70 | dayNamesShortest: |
---|
| 71 | [ |
---|
| 72 | 'D', |
---|
| 73 | 'S', |
---|
| 74 | 'T', |
---|
| 75 | 'Q', |
---|
| 76 | 'Q ', |
---|
| 77 | 'S ', |
---|
| 78 | 'S' |
---|
| 79 | ], |
---|
| 80 | |
---|
| 81 | timeunit : |
---|
| 82 | { |
---|
| 83 | 'h': 'hora', |
---|
| 84 | 'd': 'dia', |
---|
| 85 | 'm': 'minuto' |
---|
[5510] | 86 | }, |
---|
| 87 | |
---|
[7029] | 88 | alarmtype:{ |
---|
| 89 | 'alert' : 'alerta', |
---|
| 90 | 'mail' : 'email', |
---|
| 91 | 'sms': 'sms' |
---|
| 92 | }, |
---|
| 93 | |
---|
| 94 | defaultToAmPm : function (Hour) |
---|
[5510] | 95 | { |
---|
[7029] | 96 | var HourAmPm = Hour.split(":"); |
---|
| 97 | if(HourAmPm[0] == 0) |
---|
| 98 | HourAmPm[0] = 12; |
---|
| 99 | if(HourAmPm[0] < 12){ |
---|
| 100 | Hour += (Hour.length == 5) ? " am" : ""; |
---|
| 101 | }else if(HourAmPm[0] == 12){ |
---|
| 102 | Hour += (Hour.length == 5) ? " pm" : ""; |
---|
| 103 | }else |
---|
| 104 | Hour = (((HourAmPm[0]-12)>=10) ? "" : "0") +(HourAmPm[0]-12)+":"+HourAmPm[1]+ ((Hour.length == 5) ? " pm" : ""); |
---|
| 105 | return Hour; |
---|
| 106 | }, |
---|
| 107 | |
---|
| 108 | AmPmTo24 : function (Hour) |
---|
| 109 | { |
---|
[5510] | 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 | |
---|
[7029] | 127 | return Hour24h[0] + ":" + Hour24h[1]; |
---|
[5510] | 128 | }, |
---|
[7029] | 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; |
---|
| 139 | }, |
---|
| 140 | |
---|
| 141 | formatDate: function( date, format ){ |
---|
| 142 | |
---|
| 143 | return dateFormat( date, format.replace(/m/g, 'M') ); |
---|
| 144 | |
---|
| 145 | }, |
---|
| 146 | |
---|
| 147 | toString: function(date, format){ |
---|
| 148 | return dateFormat( date, format.replace(/M/g, 'm') ); |
---|
| 149 | }, |
---|
| 150 | |
---|
| 151 | decodeRange: function(date, range){ |
---|
| 152 | return (parseInt(date.getTime()) + (range * 60000)); |
---|
| 153 | } |
---|
| 154 | |
---|
| 155 | } |
---|
| 156 | |
---|