Changeset 4490 for trunk/ui/current/datepicker/index.html
- Timestamp:
- 01/20/08 22:20:24 (11 months ago)
- Files:
-
- 1 modified
-
trunk/ui/current/datepicker/index.html (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/current/datepicker/index.html
r4411 r4490 30 30 <div id="header"> 31 31 <div> 32 <h1>jQuery UI Datepicker v3. 2</h1>32 <h1>jQuery UI Datepicker v3.3</h1> 33 33 <p class="caption">Written by <a href="/">Marc Grabanski</a> and <a href="http://keith-wood.name">Keith Wood</a>.</p> 34 34 </div> … … 36 36 <?php $code_nav='ui-datepicker'; include '../code_nav.php' ?> 37 37 <div id="content"> 38 <h2>jQuery UI Datepicker v3. 2Examples</h2>38 <h2>jQuery UI Datepicker v3.3 Examples</h2> 39 39 <ul id="tab_menu1" class="tabs"> 40 40 <li><a href="#default">Defaults</a></li> … … 47 47 <li style="clear: left;"><a href="#range">Date range</a></li> 48 48 <li><a href="#misc">Miscellaneous</a></li> 49 <li><a href="# reconfig">Reconfigure</a></li>49 <li><a href="#change">Change Settings</a></li> 50 50 <li><a href="#inline">Inline</a></li> 51 51 <li><a href="#styles">Stylesheets</a></li> … … 59 59 <input type="text" size="30" value="click to show datepicker" id="defaultFocus"/></p> 60 60 <script type="text/jsdemo" charset="utf-8" class="demojs"> 61 $('#defaultFocus'). datepicker();61 $('#defaultFocus').attachDatepicker(); 62 62 </script> 63 63 <p><span class="demoLabel">IE select issue:</span> … … 96 96 <input type="button" id="enableFocus" value="Disable"/></p> 97 97 <script type="text/jsdemo" charset="utf-8" class="demojs"> 98 $('#invokeFocus'). datepicker({showOn: 'focus'});98 $('#invokeFocus').attachDatepicker({showOn: 'focus'}); 99 99 </script> 100 100 <p><span class="demoLabel">Appears via text button:</span> … … 102 102 <input type="button" id="enableButton" value="Disable"/></p> 103 103 <script type="text/jsdemo" charset="utf-8" class="demojs"> 104 $('#invokeButton'). datepicker({showOn: 'button', buttonText: '...',104 $('#invokeButton').attachDatepicker({showOn: 'button', buttonText: '...', 105 105 buttonImage: '', buttonImageOnly: false}); 106 106 </script> … … 109 109 <input type="button" id="enableBoth" value="Disable"/></p> 110 110 <script type="text/jsdemo" charset="utf-8" class="demojs"> 111 $('.invokeBoth'). datepicker({showOn: 'both', buttonImage: 'img/calendar.gif', buttonImageOnly: true});111 $('.invokeBoth').attachDatepicker({showOn: 'both', buttonImage: 'img/calendar.gif', buttonImageOnly: true}); 112 112 </script> 113 113 <p>You can embed the trigger image within the input area via CSS.</p> … … 115 115 <input type="text" size="10" id="embedButton"/></p> 116 116 <script type="text/jsdemo" charset="utf-8" class="demojs"> 117 $('#embedButton'). datepicker({showOn: 'button', buttonImage: 'img/calendar.gif', buttonImageOnly: true});117 $('#embedButton').attachDatepicker({showOn: 'button', buttonImage: 'img/calendar.gif', buttonImageOnly: true}); 118 118 119 119 // CSS … … 123 123 <script type="text/jsdemo" charset="utf-8" class="demojs"> 124 124 $('#enableFocus').toggle( 125 function () { this.value = 'Enable'; $ .datepicker.disableFor('#invokeFocus'); },126 function () { this.value = 'Disable'; $ .datepicker.enableFor('#invokeFocus'); });125 function () { this.value = 'Enable'; $('#invokeFocus').disableDatepicker(); }, 126 function () { this.value = 'Disable'; $('#invokeFocus').enableDatepicker(); }); 127 127 $('#enableButton').toggle( 128 function () { this.value = 'Enable'; $ .datepicker.disableFor($('#invokeButton')); },129 function () { this.value = 'Disable'; $ .datepicker.enableFor($('#invokeButton')); });128 function () { this.value = 'Enable'; $('#invokeButton').disableDatepicker(); }, 129 function () { this.value = 'Disable'; $('#invokeButton').enableDatepicker(); }); 130 130 $('#enableBoth').toggle( 131 function () { this.value = 'Enable'; $ .datepicker.disableFor($('.invokeBoth')[0]); },132 function () { this.value = 'Disable'; $ .datepicker.enableFor($('.invokeBoth')[0]); });131 function () { this.value = 'Enable'; $('.invokeBoth:first').disableDatepicker(); }, 132 function () { this.value = 'Disable'; $('.invokeBoth:first').enableDatepicker(); }); 133 133 </script> 134 134 <p>The date picker can also be triggered externally for a particular input.</p> … … 182 182 <input type="text" size="10" id="restrictControls"/></p> 183 183 <script type="text/jsdemo" charset="utf-8" class="demojs"> 184 $('#restrictControls'). datepicker({firstDay: 1, changeFirstDay: false,184 $('#restrictControls').attachDatepicker({firstDay: 1, changeFirstDay: false, 185 185 changeMonth: false, changeYear: false}); 186 186 </script> … … 190 190 <input type="text" size="10" id="restrictDates"/></p> 191 191 <script type="text/jsdemo" charset="utf-8" class="demojs"> 192 $('#restrictDates'). datepicker({minDate: new Date(2005, 1 - 1, 26),192 $('#restrictDates').attachDatepicker({minDate: new Date(2005, 1 - 1, 26), 193 193 maxDate: new Date(2007, 1 - 1, 26)}); 194 194 </script> … … 220 220 <input type="text" size="10" id="mediumFormat"/></p> 221 221 <script type="text/jsdemo" charset="utf-8" class="demojs"> 222 $('#mediumFormat'). datepicker({dateFormat: 'M d, yy'});222 $('#mediumFormat').attachDatepicker({dateFormat: 'M d, yy'}); 223 223 </script> 224 224 <p><span class="demoLabel">Long format:</span> 225 225 <input type="text" size="20" id="longFormat"/></p> 226 226 <script type="text/jsdemo" charset="utf-8" class="demojs"> 227 $('#longFormat'). datepicker({dateFormat: 'MM d, yy'});227 $('#longFormat').attachDatepicker({dateFormat: 'MM d, yy'}); 228 228 </script> 229 229 <p><span class="demoLabel">Full format:</span> 230 230 <input type="text" size="30" id="fullFormat"/></p> 231 231 <script type="text/jsdemo" charset="utf-8" class="demojs"> 232 $('#fullFormat'). datepicker({dateFormat: 'DD, MM d, yy'});232 $('#fullFormat').attachDatepicker({dateFormat: 'DD, MM d, yy'}); 233 233 </script> 234 234 <p>Display dates without the century. The century is then determined based on the … … 239 239 <input type="text" size="10" id="noCentury"/></p> 240 240 <script type="text/jsdemo" charset="utf-8" class="demojs"> 241 $('#noCentury'). datepicker({dateFormat: 'dd/mm/y'});241 $('#noCentury').attachDatepicker({dateFormat: 'dd/mm/y'}); 242 242 </script> 243 243 <p><span class="demoLabel">ISO date format:</span> 244 244 <input type="text" size="10" id="isoFormat"/></p> 245 245 <script type="text/jsdemo" charset="utf-8" class="demojs"> 246 $('#isoFormat'). datepicker({dateFormat: 'yy-mm-dd'});246 $('#isoFormat').attachDatepicker({dateFormat: 'yy-mm-dd'}); 247 247 </script> 248 248 <p><span class="demoLabel">French full format:</span> 249 249 <input type="text" size="30" id="frFullFormat"/></p> 250 250 <script type="text/jsdemo" charset="utf-8" class="demojs"> 251 $('#frFullFormat'). datepicker($.datepicker.regional['fr']);252 $ .datepicker.reconfigureFor('#frFullFormat',{dateFormat: 'DD, MM d, yy'});251 $('#frFullFormat').attachDatepicker($.datepicker.regional['fr']); 252 $('#frFullFormat').changeDatepicker({dateFormat: 'DD, MM d, yy'}); 253 253 </script> 254 254 <p>The formatting codes are:</p> … … 278 278 <input type="text" size="10" id="noWeekends"/></p> 279 279 <script type="text/jsdemo" charset="utf-8" class="demojs"> 280 $('#noWeekends'). datepicker({beforeShowDay: $.datepicker.noWeekends});280 $('#noWeekends').attachDatepicker({beforeShowDay: $.datepicker.noWeekends}); 281 281 </script> 282 282 <p>Or you can provide your own function. The one below highlights and … … 285 285 <input type="text" size="10" id="nationalDays"/></p> 286 286 <script type="text/jsdemo" charset="utf-8" class="demojs"> 287 $('#nationalDays'). datepicker({beforeShowDay: nationalDays});287 $('#nationalDays').attachDatepicker({beforeShowDay: nationalDays}); 288 288 289 289 // Highlight certain national days on the calendar … … 348 348 <p>And then configure the language per date picker instance.</p> 349 349 <script type="text/jsdemo" charset="utf-8" class="demojs"> 350 $('#l10nDatepicker'). datepicker($.extend({showStatus: true}, $.datepicker.regional['fr']));351 $('#rtlDatepicker'). datepicker($.extend({showStatus: true}, $.datepicker.regional['he']));350 $('#l10nDatepicker').attachDatepicker($.extend({showStatus: true}, $.datepicker.regional['fr'])); 351 $('#rtlDatepicker').attachDatepicker($.extend({showStatus: true}, $.datepicker.regional['he'])); 352 352 </script> 353 353 <p><strong>Localisation packages:</strong></p> … … 363 363 <input type="text" size="10" class="dateRange" id="dTo"/></p> 364 364 <script type="text/jsdemo" charset="utf-8" class="demojs"> 365 $('.dateRange'). datepicker({beforeShow: customRange});365 $('.dateRange').attachDatepicker({beforeShow: customRange}); 366 366 367 367 // Customize two date pickers to work as a date range … … 378 378 379 379 <script type="text/jsdemo" charset="utf-8" class="demojs"> 380 $('#rangeSelect'). datepicker({rangeSelect: true});380 $('#rangeSelect').attachDatepicker({rangeSelect: true}); 381 381 </script> 382 382 <p><span class="demoLabel">Two months with range select:</span> 383 383 <input type="text" size="25" id="rangeSelect2Months"/></p> 384 384 <script type="text/jsdemo" charset="utf-8" class="demojs"> 385 $('#rangeSelect2Months'). datepicker({rangeSelect: true, numberOfMonths: 2});385 $('#rangeSelect2Months').attachDatepicker({rangeSelect: true, numberOfMonths: 2}); 386 386 </script> 387 387 <p><span class="demoLabel">Six months with range select:</span> 388 388 <input type="text" size="25" id="rangeSelect6Months"/></p> 389 389 <script type="text/jsdemo" charset="utf-8" class="demojs"> 390 $('#rangeSelect6Months'). datepicker({rangeSelect: true, numberOfMonths: [2, 3],390 $('#rangeSelect6Months').attachDatepicker({rangeSelect: true, numberOfMonths: [2, 3], 391 391 stepMonths: 3, prevText: '<< Previous Months', nextText: 'Next Months >>'}); 392 392 </script> … … 398 398 <input type="text" size="10" id="openDateJan01"/></p> 399 399 <script type="text/jsdemo" charset="utf-8" class="demojs"> 400 $('#openDateJan01'). datepicker({defaultDate: new Date(2007, 1 - 1, 1)});400 $('#openDateJan01').attachDatepicker({defaultDate: new Date(2007, 1 - 1, 1)}); 401 401 </script> 402 402 <p><span class="demoLabel">Open at 7 days from today:</span> 403 403 <input type="text" size="10" id="openDatePlus7"/></p> 404 404 <script type="text/jsdemo" charset="utf-8" class="demojs"> 405 $('#openDatePlus7'). datepicker({defaultDate: +7});405 $('#openDatePlus7').attachDatepicker({defaultDate: +7}); 406 406 </script> 407 407 <p>Or specify a period from today - 'd' for days, … … 419 419 <input type="text" size="10" id="showWeeks"/></p> 420 420 <script type="text/jsdemo" charset="utf-8" class="demojs"> 421 $('#showWeeks'). datepicker({showWeeks: true, firstDay: 1, changeFirstDay: false, showOtherMonths: true});421 $('#showWeeks').attachDatepicker({showWeeks: true, firstDay: 1, changeFirstDay: false, showOtherMonths: true}); 422 422 </script> 423 423 <p>Additional settings let you move the <em>Clear</em>/<em>Close</em> controls … … 431 431 <input type="text" size="10" id="addSettings"/></p> 432 432 <script type="text/jsdemo" charset="utf-8" class="demojs"> 433 $('#addSettings'). datepicker({433 $('#addSettings').attachDatepicker({ 434 434 closeAtTop: false, 435 435 mandatory: true, … … 485 485 <input type="hidden" size="10" id="linkedDates" disabled="disabled"/></p> 486 486 <script type="text/jsdemo" charset="utf-8" class="demojs"> 487 $('#linkedDates'). datepicker({487 $('#linkedDates').attachDatepicker({ 488 488 minDate: new Date(2001, 1 - 1, 1), 489 489 maxDate: new Date(2010, 12 - 1, 31), … … 523 523 </script> 524 524 </div> 525 <div id=" reconfig" class="tab_group1 container">526 <h3> Reconfiguration</h3>527 <p>If necessary, the date picker for an input (or set of inputs) can be reconfigured528 on the fly. As an example, here we change the speed at which the date picker appears.</p>525 <div id="change" class="tab_group1 container"> 526 <h3>Changing Settings</h3> 527 <p>If necessary, the datepicker settings for an input (or set of inputs) can be changed 528 on the fly. As an example, here we change the speed at which the datepicker appears.</p> 529 529 <p><span class="demoLabel">Display speed:</span> 530 530 <select id="speedSelectr"> … … 535 535 </select> 536 536 </p> 537 <p><span class="demoLabel"> Reconfigured datepicker:</span>538 <input type="text" size="10" id=" reconfigureCal"/></p>537 <p><span class="demoLabel">Change datepicker:</span> 538 <input type="text" size="10" id="changeDP"/></p> 539 539 <p>When the option in the select changes, the following function is called:</p> 540 540 <script type="text/jsdemo" charset="utf-8" class="demojs"> 541 $('# reconfigureCal').datepicker();542 // Reconfigure the calendar to selected speed.541 $('#changeDP').attachDatepicker(); 542 // Change the datepicker to selected speed. 543 543 $("#speedSelectr").change(function() { 544 $ .datepicker.reconfigureFor('#reconfigureCal',{speed: $(this).val()});544 $('#changeDP').changeDatepicker({speed: $(this).val()}); 545 545 }); 546 546 </script> … … 569 569 570 570 // Invoke inline configured datepickers 571 $('.inlineConfig'). datepicker();571 $('.inlineConfig').attachDatepicker(); 572 572 </script> 573 573 </div> … … 580 580 <script type="text/jsdemo" charset="utf-8" class="demojs"> 581 581 // HTML <span id="inlineDemo"></span> 582 $('#inlineDemo'). datepicker({582 $('#inlineDemo').attachDatepicker({ 583 583 onSelect: function(date) { 584 584 alert(date); … … 596 596 </p> 597 597 <script type="text/jsdemo" charset="utf-8" class="demojs"> 598 $('#rangeInline'). datepicker({rangeSelect: true, rangeSeparator: ' to ',598 $('#rangeInline').attachDatepicker({rangeSelect: true, rangeSeparator: ' to ', 599 599 numberOfMonths: 2, onSelect: updateInlineRange}); 600 600 $('#rangeInline').find('div:first').width(370); // Unfortunately not automatic … … 755 755 Customize each calendar with <a href="http://docs.jquery.com/UI/Datepicker/datepicker#options" target="_blank">additional settings</a> 756 756 as part of the initialization if necessary. 757 <pre><code class="javascript">$('input selector'). datepicker();758 $('input selector'). datepicker({defaultDate: +7});</code></pre>757 <pre><code class="javascript">$('input selector').attachDatepicker(); 758 $('input selector').attachDatepicker({defaultDate: +7});</code></pre> 759 759 </li> 760 760 </ol>
