Changeset 5510
- Timestamp:
- 02/14/12 09:21:16 (11 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 1 nbproject 2 3 2 header.inc.php 3 ._header.inc.php
-
- Property svn:ignore
-
trunk/prototype/modules/calendar/css/style.css
r5442 r5510 181 181 } 182 182 183 .mini-calendar .ui-datepicker { width: auto; }183 .mini-calendar .ui-datepicker { width: auto; background: none repeat scroll 0 0 transparent; } 184 184 .mini-calendar .ui-widget-content { border: none; background-color: transparent; } 185 185 .mini-calendar .ui-widget-header { background: transparent; color: #000; border: 0 none;} -
trunk/prototype/modules/calendar/js
-
Property
svn:ignore
set to
._helpers.js
._init.js
._calendar.date.js
-
Property
svn:ignore
set to
-
trunk/prototype/modules/calendar/js/calendar.date.js
r5437 r5510 102 102 Hour += (Hour.length == 5) ? " pm" : ""; 103 103 }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" : ""); 105 105 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; 106 139 }, 107 140 -
trunk/prototype/modules/calendar/js/helpers.js
r5442 r5510 19 19 var startDate = Date.parseExact( isAllDay ? start_date+ " 00:00": start_date + " " + $.trim(start_time) , formatString ); 20 20 var endDate = Date.parseExact( isAllDay ? end_date+ " 00:00": end_date + " " + $.trim(end_time) , formatString ); 21 21 22 22 if(startDate == null || startDate.getTime() < 0 ) 23 23 return 'Data inicial inválida'; … … 676 676 677 677 tabPrefCalendar.find('.number').numeric(); 678 679 tabPrefCalendar.find('input.time').timepicker({ 680 closeText: 'Ok', 681 hourGrid: 4, 682 minuteGrid: 10, 683 ampm : (parseInt($("select[name=hourFormat] option:selected").val().length) > 5 ? true : false), //((User.preferences.hourFormat.length > 5) ? true: false), 684 timeFormat: "hh:mm tt", 685 onSelect: function (selectedDateTime){ 686 if(!(User.preferences.hourFormat.length == 5)) { 687 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 688 } 689 }, 690 onClose : function (selectedDateTime){ 691 if(!(User.preferences.hourFormat.length == 5)) { 692 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 693 } 694 } 695 }); 696 697 $.mask.definitions['{']='[ap]'; 698 $.mask.definitions['}']='[m]'; 699 tabPrefCalendar.find("input.time").mask( ((User.preferences.hourFormat.length > 5) ? "99:99 {}" : "99:99"), { 700 completed:function(){ 701 $(this).val(dateCalendar.defaultToAmPm($(this).val())); 702 $(this).timepicker("refresh"); 703 $(this).val($(this).val().replace(/[\.]/gi, "")); 704 } 705 }); 706 707 tabPrefCalendar.find("select[name=hourFormat]").change( function() { // evento ao selecionar formato de hora 708 709 tabPrefCalendar.find("input.time").timepicker("destroy"); 710 711 tabPrefCalendar.find('input.time').timepicker({ 712 closeText: 'Ok', 713 hourGrid: 4, 714 minuteGrid: 10, 715 ampm : (parseInt($("select[name=hourFormat] option:selected").val().length) > 5 ? true : false), 716 timeFormat: "hh:mm tt", 717 onSelect: function (selectedDateTime){ 718 if(!(User.preferences.hourFormat.length == 5)) { 719 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 720 } 721 }, 722 onClose : function (selectedDateTime){ 723 if(!(User.preferences.hourFormat.length == 5)) { 724 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 725 } 726 } 727 }); 728 729 var defaultStartHour = tabPrefCalendar.find("input[name=defaultStartHour]").val().trim(); 730 var defaultEndHour = tabPrefCalendar.find("input[name=defaultEndHour]").val().trim(); 731 732 tabPrefCalendar.find("input.time").mask( (($("select[name=hourFormat] option:selected").val().trim().length > 5) ? "99:99 {}" : "99:99") ); 733 734 if (parseInt($("select[name=hourFormat] option:selected").val().length) > 5) { // am/pm 735 tabPrefCalendar.find("input[name=defaultStartHour]").val(dateCalendar.defaultToAmPm(defaultStartHour)); 736 tabPrefCalendar.find("input[name=defaultEndHour]").val(dateCalendar.defaultToAmPm(defaultEndHour)) 737 738 } else { //24h 739 tabPrefCalendar.find("input[name=defaultStartHour]").val(dateCalendar.AmPmTo24(defaultStartHour)); 740 tabPrefCalendar.find("input[name=defaultEndHour]").val(dateCalendar.AmPmTo24(defaultEndHour)); 741 } 742 }); 743 744 745 678 746 }); 679 747 } else { -
trunk/prototype/modules/calendar/js/init.js
r5442 r5510 1 1 $(document).ready(function() { 2 3 2 refresh_calendars(); 4 3 $tabs = $('#tabs').tabs({ … … 163 162 right: 'agendaDay,agendaWeek,month,year' 164 163 }, 164 firstHour: dateCalendar.getShortestTime(User.preferences.defaultStartHour ? User.preferences.defaultStartHour : '6'), 165 165 firstDay: dateCalendar.dayOfWeek[User.preferences.weekStart], 166 166 editable: true, … … 197 197 */ 198 198 select: function( start, end, allDay, event, view ){ 199 if (view.name == "month") { 200 if (User.preferences.defaultStartHour) { 201 _start = User.preferences.defaultStartHour; 202 203 if (_start.length > 4) 204 _start = _start.trim().substring(0,5); // remove o am/pm 205 206 _start = _start.split(":"); 207 start.setHours(_start[0]); 208 start.setMinutes(_start[1]); 209 } 210 211 if (User.preferences.defaultEndHour) { 212 _end = User.preferences.defaultEndHour; 213 if (_end.length > 4) 214 _end = _end.trim().substring(0,5); // remove o am/pm 215 216 _end = _end.split(":"); 217 end.setHours(_end[0]); 218 end.setMinutes(_end[1]); 219 } 220 } // END if (view.name == "month") 221 199 222 eventDetails( { 'start': start, 200 223 'end': end, -
trunk/prototype/modules/calendar/templates
-
Property
svn:ignore
set to
._preferences_calendar.ejs
-
Property
svn:ignore
set to
-
trunk/prototype/modules/calendar/templates/preferences_calendar.ejs
r5341 r5510 54 54 <option value="SAT" <%= data.preferences.weekStart =='SAT' ? 'selected="selected"':'' %>>Sábado</option> 55 55 </select> 56 </p> 57 58 <p class="input-group"> 59 <label for="defaultStartHour">Hora de início padrão:</label> 60 <input type="text" class="time" value="<%= (data.preferences.defaultStartHour) ? data.preferences.defaultStartHour : '' %>" name="defaultStartHour" /> 61 </p> 62 63 <p class="input-group"> 64 <label for="defaultEndHour">Hora de término padrão:</label> 65 <input type="text" class="time" value="<%= (data.preferences.defaultEndHour) ? data.preferences.defaultEndHour : '' %>" name="defaultEndHour" /> 56 66 </p> 57 67
Note: See TracChangeset
for help on using the changeset viewer.