- Timestamp:
- 2013/01/08 17:52:03 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-multilang/data/Smarty/templates/admin/customer/edit.tpl
r22205 r22212 30 30 return false; 31 31 } 32 33 $(function(){ 34 $.datepicker.setDefaults( $.datepicker.regional[ "<!--{$smarty.const.LANG_CODE}-->" ] ); 35 36 $( "#datepickercustomer_edit" ).datepicker({ 37 beforeShowDay: function(date) { 38 if(date.getDay() == 0) { 39 return [true,"date-sunday"]; 40 } else if(date.getDay() == 6){ 41 return [true,"date-saturday"]; 42 } else { 43 return [true]; 44 } 45 },changeMonth: 'true' 46 ,changeYear: 'true' 47 ,onSelect: function(dateText, inst){ 48 setDatecustomer_edit(dateText); 49 }, 50 showButtonPanel: true, 51 beforeShow: showAdditionalButtoncustomer_edit, 52 onChangeMonthYear: showAdditionalButtoncustomer_edit 53 }); 54 55 $("#datepickercustomer_edit").blur( function() { 56 var dateText = $(this).val(); 57 setDatecustomer_edit(dateText); 58 }); 59 60 }); 61 62 var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>'); 63 64 var showAdditionalButtoncustomer_edit = function (input) { 65 setTimeout(function () { 66 var buttonPane = $(input) 67 .datepicker("widget") 68 .find(".ui-datepicker-buttonpane"); 69 btn 70 .unbind("click") 71 .bind("click", function () { 72 $.datepicker._clearDate(input); 73 $("*[name=year]").val(""); 74 $("*[name=month]").val(""); 75 $("*[name=day]").val(""); 76 }); 77 btn.appendTo(buttonPane); 78 }, 1); 79 }; 80 81 function setDatecustomer_edit(dateText){ 82 var dates = dateText.split('/'); 83 $("*[name=year]").val(dates[0]); 84 $("*[name=month]").val(dates[1]); 85 $("*[name=day]").val(dates[2]); 86 } 32 87 //--> 33 88 </script> … … 169 224 <div class="attention"><!--{$errBirth}--></div> 170 225 <!--{/if}--> 171 <input id="datepicker " type="text" value="<!--{if $arrForm.year != "" && $arrForm.month != "" && $arrForm.day != ""}--><!--{$arrForm.year|h}-->/<!--{$arrForm.month|h|string_format:'%02d'}-->/<!--{$arrForm.day|h|string_format:'%02d'}--><!--{/if}-->" <!--{if $arrErr.year != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> />226 <input id="datepickercustomer_edit" type="text" value="<!--{if $arrForm.year != "" && $arrForm.month != "" && $arrForm.day != ""}--><!--{$arrForm.year|h}-->/<!--{$arrForm.month|h|string_format:'%02d'}-->/<!--{$arrForm.day|h|string_format:'%02d'}--><!--{/if}-->" <!--{if $arrErr.year != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 172 227 <input type="hidden" name="year" value="<!--{$arrForm.year}-->" /> 173 228 <input type="hidden" name="month" value="<!--{$arrForm.month}-->" />
Note: See TracChangeset
for help on using the changeset viewer.