Changeset 4500
- Timestamp:
- 01/21/08 12:22:09 (1 year ago)
- Files:
-
- 1 modified
-
trunk/ui/current/datepicker/index.html (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/current/datepicker/index.html
r4493 r4500 46 46 <li><a href="#l10n">Localisation</a></li> 47 47 <li style="clear: left;"><a href="#range">Date range</a></li> 48 <li><a href="#misc">Miscellaneous</a></li> 48 <li><a href="#misc1">Misc. 1</a></li> 49 <li><a href="#misc2">Misc. 2</a></li> 49 50 <li><a href="#change">Change Settings</a></li> 50 51 <li><a href="#inline">Inline</a></li> … … 137 138 <script type="text/jsdemo" charset="utf-8" class="demojs"> 138 139 $('#button1').click(function() { 139 $ .datepicker.showFor('#invokeFocus');140 $('#invokeFocus').showDatepicker(); 140 141 }); 141 142 </script> … … 198 199 <input type="text" size="10" id="relativeDates"/></p> 199 200 <script type="text/jsdemo" charset="utf-8" class="demojs"> 200 $('#relativeDates'). datepicker({minDate: 0, maxDate: 365});201 $('#relativeDates').attachDatepicker({minDate: 0, maxDate: 365}); 201 202 </script> 202 203 <p>The relative dates can also be specified as a number and a period - … … 205 206 <input type="text" size="10" id="extendedDates"/></p> 206 207 <script type="text/jsdemo" charset="utf-8" class="demojs"> 207 $('#extendedDates'). datepicker({minDate: '-1d', maxDate: '6y'});208 $('#extendedDates').attachDatepicker({minDate: '-1d', maxDate: '6y'}); 208 209 </script> 209 210 <p>Note that the range of selectable months and years changes appropriately. Also, … … 337 338 <p><span class="demoLabel"> 338 339 <select class="languageSelect"> 339 <option value="he" >עברית (Hebrew)</option>340 <option value="he" selected="selected">עברית (Hebrew)</option> 340 341 </select>:</span> 341 342 <input type="text" size="10" id="rtlDatepicker"/></p> … … 367 368 // Customize two date pickers to work as a date range 368 369 function customRange(input) { 369 return {minDate: (input.id == 'dTo' ? $ .datepicker.getDateFor('#dFrom') : null),370 maxDate: (input.id == 'dFrom' ? $ .datepicker.getDateFor('#dTo') : null)};370 return {minDate: (input.id == 'dTo' ? $('#dFrom').getDatepickerDate() : null), 371 maxDate: (input.id == 'dFrom' ? $('#dTo').getDatepickerDate() : null)}; 371 372 } 372 373 </script> … … 392 393 </script> 393 394 </div> 394 <div id="misc " class="tab_group1 container">395 <h3>Miscellaneous </h3>395 <div id="misc1" class="tab_group1 container"> 396 <h3>Miscellaneous 1</h3> 396 397 <p>Set the date shown when first opening the date picker. The default is today.</p> 397 398 <p><span class="demoLabel">Open at 01-Jan-2007:</span> … … 410 411 <input type="text" size="10" id="openDate2Weeks"/></p> 411 412 <script type="text/jsdemo" charset="utf-8" class="demojs"> 412 $('#openDate2Weeks'). datepicker({defaultDate: '2w'});413 $('#openDate2Weeks').attachDatepicker({defaultDate: '2w'}); 413 414 </script> 414 415 <p>Show the weeks of the year. Defaults to the ISO 8601 definition (weeks start … … 452 453 (today.getTime() == date.getTime() ? ' (today)' : ''); 453 454 } 455 </script> 456 </div> 457 <div id="misc2" class="tab_group1 container"> 458 <h3>Miscellaneous 2</h3> 459 <p>Remove the datepicker if you've finished with it.</p> 460 <p><span class="demoLabel">Remove popup datepicker:</span> 461 <input type="text" size="10" class="removeDatepicker"/><button id="removeButton">Remove</button></p> 462 <p><span class="demoLabel">Remove inline datepicker:</span> 463 <span class="removeDatepicker"></span></p> 464 <script type="text/jsdemo" charset="utf-8" class="demojs"> 465 var opts = {beforeShowDay: $.datepicker.noWeekends}; 466 $('.removeDatepicker').attachDatepicker(opts); 467 $('#removeButton').toggle(function() { 468 $(this).text('Re-attach'); 469 $('.removeDatepicker').removeDatepicker(); 470 }, 471 function() { 472 $(this).text('Remove'); 473 $('.removeDatepicker').attachDatepicker(opts); 474 } 475 ); 454 476 </script> 455 477 <p><strong>(Advanced Technique)</strong><br />Connect the date picker to linked drop-downs. You still need an input field, … … 525 547 <div id="change" class="tab_group1 container"> 526 548 <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 <p><span class="demoLabel">Display speed:</span> 530 <select id="speedSelectr"> 549 <p>If necessary, the datepicker settings for an input (or set of inputs) 550 can be changed on the fly. As an example, here we change the 551 animation and speed at which the datepicker appears.</p> 552 <p><span class="demoLabel">Display animation and speed:</span> 553 <select id="animSelector"> 554 <option value="show">show</option> 555 <option value="fadeIn">fade in</option> 556 <option value="slideDown">slide down</option> 557 </select> 558 <select id="speedSelector"> 531 559 <option value="">immediate</option> 532 560 <option value="slow">slow</option> … … 541 569 $('#changeDP').attachDatepicker(); 542 570 // Change the datepicker to selected speed. 543 $("#speedSelectr").change(function() { 544 $('#changeDP').changeDatepicker({speed: $(this).val()}); 571 $("#animSelector,#speedSelector").change(function() { 572 $('#changeDP').changeDatepicker({'showAnim': $('#animSelector').val(), 573 'speed': $('#speedSelector').val()}); 545 574 }); 546 575 </script> … … 602 631 // Display the date range from a multi-month inline date picker 603 632 function updateInlineRange(dateStr) { 604 var dates = $ .datepicker.getDateFor('#rangeInline');633 var dates = $('#rangeInline').getDatepickerDate(); 605 634 var dateFormat = $.datepicker.regional[''].dateFormat; 606 635 $('#inlineRange').val(dateStr ? dateStr : … … 624 653 $("#setInlineRange").click(function() { 625 654 // Set Inline Date Range Selection 626 $ .datepicker.setDateFor('#rangeInline',lastWeek, nextWeek);655 $('#rangeInline').setDatepickerDate(lastWeek, nextWeek); 627 656 628 657 // Update text field with current date selections 629 var dates = $ .datepicker.getDateFor('#rangeInline');658 var dates = $('#rangeInline').getDatepickerDate(); 630 659 var dateFormat = $.datepicker.regional[''].dateFormat; 631 660 $('#inlineRange').val($.datepicker.formatDate(dateFormat, dates[0]) + ' to ' + … … 688 717 <div id="compat" class="tab_group1 container"> 689 718 <h3>Compatibility</h3> 719 <h4>v2.x to v3.3</h4> 690 720 <p>The date picker has been refactored to better fit 691 721 within the <a href="http://ui.jquery.com">jQuery UI</a> project. … … 700 730 <script type="text/javascript" src="<b>ui.datepicker.js</b>"></script> 701 731 <script type="text/javascript" src="<b>jquery-calendar-compatibility.js</b>"></script></code></pre> 702 <p>Download the <a href="compatibility/jquery-calendar-compatibility.js" target="_blank">jquery-calendar-compatibility.js</a> </p>732 <p>Download the <a href="compatibility/jquery-calendar-compatibility.js" target="_blank">jquery-calendar-compatibility.js</a> module.</p> 703 733 <p>To migrate fully, the following steps need to be taken:</p> 704 734 <ul> 705 <li>Replace references to the <code>datepicker</code>706 with <code>attachDatepicker</code>.</li>707 <li>Replace references to the <code>$.datpicker.reconfigureFor</code>708 with <code>changeDatepicker</code>.</li>709 <li>Replace references to the <code>$.datpicker.enableFor</code>710 with <code>enableDatepicker</code>.</li>711 <li>Replace references to the <code>$.datpicker.disableFor</code>712 with <code>disableDatepicker</code>.</li>713 735 <li>Replace references to the <code>jquery-calendar*</code> 714 736 files with <code>ui.datepicker*</code>.</li> … … 716 738 object with <code>$.datepicker</code>.</li> 717 739 <li>Replace references to the <code>calendar</code> 718 function with <code> datepicker</code>.</li>740 function with <code>attachDatepicker</code>.</li> 719 741 <li>Replace references to the <code>autoPopUp</code> 720 742 setting with <code>showOn</code>.</li> … … 729 751 <li>Replace references to the <code>dialogCalendar</code> 730 752 function with <code>dialogDatepicker</code>.</li> 753 <li>Replace references to the <code>$.datepicker.reconfigureFor(selector, ...)</code> 754 function with <code>$(selector).changeDatepicker(...)</code>.</li> 755 <li>Replace references to the <code>$.datepicker.enableFor(selector)</code> 756 function with <code>$(selector).enableDatepicker()</code>.</li> 757 <li>Replace references to the <code>$.datepicker.disableFor(selector)</code> 758 function with <code>$(selector).disableDatepicker()</code>.</li> 759 <li>Replace references to the <code>$.datepicker.getDateFor(selector)</code> 760 function with <code>$(selector).getDatepickerDate()</code>.</li> 761 <li>Replace references to the <code>$.datepicker.setDateFor(selector, ...)</code> 762 function with <code>$(selector).setDatepickerDate(...)</code>.</li> 731 763 <li>Replace references to the <code>calendar*</code> 732 764 CSS styles with <code>datepicker*</code>.</li> … … 742 774 743 775 <input type="text" id="inlineConfig" <b>date:</b>defaultDate="+7"/></code></pre> 776 <h4>v3.2 to v3.3</h4> 777 <p>To align the datepicker more closely with other jQuery UI components, 778 further changes were made in v3.3, resulting in another compatibility module.</p> 779 <p>Users of v3.2 of the datepicker should use the following 780 header code to work with their existing implementation:</p> 781 <pre><code class="html"><link rel="stylesheet" type="text/css" href="<b>ui.datepicker.css</b>"/> 782 <script type="text/javascript" src="<b>ui.datepicker.js</b>"></script> 783 <script type="text/javascript" src="<b>ui.datepicker.compatibility-3.2.js</b>"></script></code></pre> 784 <p>Download the <a href="compatibility/ui.datepicker.compatibility-3.2.js" target="_blank">ui.datepicker.compatibility-3.2.js</a> module.</p> 785 <p>To migrate fully, the following steps need to be taken:</p> 786 <ul> 787 <li>Replace references to the <code>datepicker</code> 788 function with <code>attachDatepicker</code>.</li> 789 <li>Replace references to the <code>$.datepicker.reconfigureFor(selector, ...)</code> 790 function with <code>$(selector).changeDatepicker(...)</code>.</li> 791 <li>Replace references to the <code>$.datepicker.enableFor(selector)</code> 792 function with <code>$(selector).enableDatepicker()</code>.</li> 793 <li>Replace references to the <code>$.datepicker.disableFor(selector)</code> 794 function with <code>$(selector).disableDatepicker()</code>.</li> 795 <li>Replace references to the <code>$.datepicker.getDateFor(selector)</code> 796 function with <code>$(selector).getDatepickerDate()</code>.</li> 797 <li>Replace references to the <code>$.datepicker.setDateFor(selector, ...)</code> 798 function with <code>$(selector).setDatepickerDate(...)</code>.</li> 799 </ul> 800 <p>For example, this old style code:</p> 801 <pre><code class="javascript">$('inputs').<b>datepicker</b>(); 802 $.<b>datepicker.reconfigureFor</b>('inputs', {...});</code></pre> 803 <p>becomes:</p> 804 <pre><code class="javascript">$('inputs').<b>attachDatepicker</b>(); 805 $('input').<b>changeDatepicker</b>({...});</code></pre> 744 806 </div> 745 807 <!--DEMO
