diff options
author | Keith Wood <kbwood.au@gmail.com> | 2008-06-12 12:09:40 +0000 |
---|---|---|
committer | Keith Wood <kbwood.au@gmail.com> | 2008-06-12 12:09:40 +0000 |
commit | 854d60dc83641f7ea2ae92faf0f092f954e045f3 (patch) | |
tree | 4df9a9fd79b2fbdb0d10b312507035e53b09dfd7 /demos/functional/templates | |
parent | 3f73801856b64801df5e1b262494f7f8bbc12a9c (diff) | |
download | jquery-ui-854d60dc83641f7ea2ae92faf0f092f954e045f3.tar.gz jquery-ui-854d60dc83641f7ea2ae92faf0f092f954e045f3.zip |
Datepicker demo enhancements
Diffstat (limited to 'demos/functional/templates')
-rw-r--r-- | demos/functional/templates/ui.datepicker.dbd.html | 5 | ||||
-rw-r--r-- | demos/functional/templates/ui.datepicker.html | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/demos/functional/templates/ui.datepicker.dbd.html b/demos/functional/templates/ui.datepicker.dbd.html index 39bc6ffca..c77f7bac0 100644 --- a/demos/functional/templates/ui.datepicker.dbd.html +++ b/demos/functional/templates/ui.datepicker.dbd.html @@ -32,4 +32,9 @@ function highlightToday(date, inst) { return $.datepicker.dateStatus(date, inst) +
(today.getTime() == date.getTime() ? ' (today)' : '');
}
+
+function showDayOfYear(date) {
+ var lastYearEnd = new Date(date.getFullYear() - 1, 12 - 1, 31, 0, 0, 0, 0);
+ return [true, '', 'Day ' + ((date.getTime() - lastYearEnd.getTime()) / 86400000) + ' of the year'];
+}
</script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.datepicker.html b/demos/functional/templates/ui.datepicker.html index 00b3a3e03..2a4af253a 100644 --- a/demos/functional/templates/ui.datepicker.html +++ b/demos/functional/templates/ui.datepicker.html @@ -24,9 +24,9 @@ '<li>Days in other months are not displayed</li>' + '<li>No date restrictions</li>' + '<li>Clicking elsewhere closes the date picker</li></ul>', - html: '<input type="text" size="30" value="click to show datepicker" id="basics"/>\n' + + html: '<input type="text" size="10" value="click here" id="basics"/>\n' + '<style type="text/css">.embed + img { position: relative; left: -21px; top: -1px; }</style>', - destroy: '$("#basics").datepicker("destroy").removeClass();', + destroy: '$("#basics").removeClass("embed").datepicker("enable").datepicker("destroy");', options: [ { desc: 'Default datepicker - open on focus', source: '$("#basics").datepicker();' }, @@ -113,6 +113,7 @@ options: [ { desc: 'Weekends are not selectable', source: '$("#dayByDay").datepicker({beforeShowDay: $.datepicker.noWeekends, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, { desc: 'Highlight some national days (via CSS)', source: '$("#dayByDay").datepicker({beforeShowDay: nationalDays, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, + { desc: 'Show day of year as cell title', source: '$("#dayByDay").datepicker({beforeShowDay: showDayOfYear, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, { desc: 'Customise status line for today', source: '$("#dayByDay").datepicker({showStatus: true, statusForDate: highlightToday, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' } ] }, @@ -126,7 +127,8 @@ options: [ { desc: 'Range select with a single month', source: '$("#ranges").datepicker({rangeSelect: true, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, { desc: 'Range select showing two months', source: '$("#ranges").datepicker({rangeSelect: true, numberOfMonths: 2, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, - { desc: 'Range select showing six months (moving three at a time)', source: '$("#ranges").datepicker({rangeSelect: true, numberOfMonths: [2, 3], stepMonths: 3, prevText: "<< Previous Months", nextText: "Next Months >>", showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' } + { desc: 'Range select showing six months (moving three at a time)', source: '$("#ranges").datepicker({rangeSelect: true, numberOfMonths: [2, 3], stepMonths: 3, prevText: "<< Previous Months", nextText: "Next Months >>", showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, + { desc: 'Range select excluding weekends', source: '$("#ranges").datepicker({rangeSelect: true, numberOfMonths: 2, beforeShowDay: $.datepicker.noWeekends, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, ] }, @@ -185,7 +187,8 @@ options: [ { desc: 'On select', source: '$("#callbacks").datepicker({onSelect: function(date) { alert("The chosen date is " + date); }, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, - { desc: 'On close', source: '$("#callbacks").datepicker({onClose: function(date) { alert("Closed with date " + date); }, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' } + { desc: 'On close', source: '$("#callbacks").datepicker({onClose: function(date) { alert("Closed with date " + date); }, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }, + { desc: 'On change of month/year', source: '$("#callbacks").datepicker({onChangeMonthYear: function(date) { alert("Moved to month " + $.datepicker.formatDate("MM yy", date)); }, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' } ] }, @@ -272,7 +275,7 @@ { desc: 'Magyar (Hungarian)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["hu"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("Istvan Karaszi");' }, { desc: 'Nederlands (Dutch)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["nl"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("???");' }, { desc: '日本語 (Japanese)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["ja"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("Milly");' }, - { desc: 'Latviešu Valoda (Latvian)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["lv"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("Arturas Paleicikas");' }, + { desc: 'Latviešu Valoda (Latvian)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["lv"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("Arturas Paleicikas");' }, { desc: 'lietuvių kalba (Lithuanian)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["lt"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("Arturas Paleicikas");' }, { desc: 'Norsk (Norwegian)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["no"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("Naimdjon Takhirov");' }, { desc: 'Phasa thai (Thai)', source: '$("#i18n").datepicker($.extend({}, $.datepicker.regional["th"], {showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true}));$("#contrib").html("pipo");' }, |