Skip to content
Permalink
Browse files

Demonstrate callbacks on range datepickers

  • Loading branch information
Keith Wood
Keith Wood committed Jun 13, 2008
1 parent b8b2a5a commit f27c0b77bff396f57e8e280cf5da658fffc34dfd
Showing with 5 additions and 2 deletions.
  1. +5 −2 demos/functional/templates/ui.datepicker.html
@@ -182,13 +182,16 @@
{
title: 'Callbacks',
desc: 'Custom functions may be invoked when certain events occur within the datepicker.',
html: '<input type="text" size="10" value="" id="callbacks"/>',
html: '<input type="text" size="24" value="" id="callbacks"/>',
destroy: '$("#callbacks").datepicker("destroy");',

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 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});' }
{ 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});' },
{ desc: 'On select for range', source: '$("#callbacks").datepicker({onSelect: function(date) { alert("The chosen dates are " + date); }, rangeSelect: true, numberOfMonths: 2, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' },
{ desc: 'On close for range', source: '$("#callbacks").datepicker({onClose: function(date) { alert("Closed with dates " + date); }, rangeSelect: true, numberOfMonths: 2, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' },
{ desc: 'On change of month/year for range', source: '$("#callbacks").datepicker({onChangeMonthYear: function(date) { alert("Moved to month " + $.datepicker.formatDate("MM yy", date)); }, rangeSelect: true, numberOfMonths: 2, showOn: "both", buttonImage: "templates/images/calendar.gif", buttonImageOnly: true});' }
]
},

0 comments on commit f27c0b7

Please sign in to comment.
You can’t perform that action at this time.