Changeset 15843
- Timestamp:
- 02/27/09 07:12:54 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfFormExtraPlugin/lib/widget/sfWidgetFormJQueryDate.class.php
r15842 r15843 87 87 } 88 88 89 function wfd_%s_check_linked_days() 90 { 91 var daysInMonth = 32 - new Date(jQuery("#%s").val(), jQuery("#%s").val() - 1, 32).getDate(); 92 jQuery("#%s option").attr("disabled", ""); 93 jQuery("#%s option:gt(" + (%s) +")").attr("disabled", "disabled"); 94 95 if (jQuery("#%s").val() > daysInMonth) 96 { 97 jQuery("#%s").val(daysInMonth); 98 } 99 } 100 89 101 jQuery(document).ready(function() { 90 102 jQuery("#%s").datepicker(jQuery.extend({}, { … … 97 109 }, jQuery.datepicker.regional["%s"], %s)); 98 110 }); 111 112 jQuery("#%s, #%s, #%s").change(wfd_%s_check_linked_days); 99 113 </script> 100 114 EOF … … 104 118 $prefix, 105 119 $this->generateId($name.'[day]'), $this->generateId($name.'[month]'), $this->generateId($name.'[year]'), 120 $prefix, 121 $this->generateId($name.'[year]'), $this->generateId($name.'[month]'), 122 $this->generateId($name.'[day]'), $this->generateId($name.'[day]'), 123 ($this->getOption('can_be_empty') ? 'daysInMonth' : 'daysInMonth - 1'), 124 $this->generateId($name.'[day]'), $this->generateId($name.'[day]'), 106 125 $id, 107 126 min($this->getOption('years')), max($this->getOption('years')), 108 $prefix, $prefix, $image, $this->getOption('culture'), $this->getOption('config') 127 $prefix, $prefix, $image, $this->getOption('culture'), $this->getOption('config'), 128 $this->generateId($name.'[day]'), $this->generateId($name.'[month]'), $this->generateId($name.'[year]'), 129 $prefix 109 130 ); 110 131 } plugins/sfFormExtraPlugin/package.xml
r15842 r15843 130 130 <license>MIT</license> 131 131 <notes> 132 * fabien: added JS date selection validity check (based on a patch from h0nIg - #4693) 132 133 * fabien: fixed date picker on IE7 (#4751) 133 134 * fabian: fixed javascript function names (#5261)