Samples

 

JavaScript API : Quick Start

Example

Start Date

End Date
 

Remarks

Basic Date Picker includes a powerful client side JavaScript API. Custom user defined JavaScript functions can be called. See:

  1. OnClientBeforeCalendarDisplay - fires before the Calendar is opened .
  2. OnClientAfterCalendarDisplay - fires after the Calendar is opened.
  3. OnClientBeforeVisibleMonthChanged - fires before the month is changed.
  4. OnClientAfterVisibleMonthChanged - fires after the month is changed
  5. OnClientBeforeSelectionChanged - fires before a new date is selected.
  6. OnClientAfterSelectionChanged - fires after a new date is selected.
  7. OnClientDayRender - fires on creation of each day. Parameters passed to custom function include:
    1. Sender (BasicDatePicker) object
    2. Date being created
    3. Cell
Download Basic Date Picker Trial

The Basic Date Picker JavaScript API includes the following client-side functions:

[JavaScript]

// Get the Id of the current date picker.
basicDatePicker.getControlId() 

// Set the SelectedDate of the current date picker.
basicDatePicker.setSelectedDate(date) 

// Set the SelectedDate of another date picker.
basicDatePicker.setSelectedDate(date, datePickerId) 

// Get the SelectedDate of the current date picker as a Date object.
basicDatePicker.getSelectedDate() 

// Get the SelectedDate of another date picker as a Date object.
basicDatePicker.getSelectedDate(datePickerId) 

// Get the SelectedDate as a formatted string
// of the current date picker.
// Same formatted value which appears in the textbox.
basicDatePicker.getSelectedDateFormatted() 

// Get the SelectedDate as a formatted string of another date picker.
// Same formatted value which appears in the textbox.
basicDatePicker.getSelectedDateFormatted(datePickerId) 

// Get boolean(true/false) of Enabled status of current date picker.
basicDatePicker.getEnabled() 

// Get boolean(true/false) of Enabled status of another date picker.
basicDatePicker.getEnabled(datePickerId) 

// Set Enabled status of current date picker.
basicDatePicker.setEnabled(bool) 

// Set Enabled status of another date picker.
basicDatePicker.setEnabled(bool, datePickerId) 



Date Helpers - Extends JavaScript Date object
// Add specified number of days to a Date.
Date.addDays(numberOfDays) 

// Add specified number of Months to Date object.
Date.addMonths(numberOfMonths) 

// Add specified number of Years to Date object.
Date.addYears(numberOfYears)

// Add specified number of Hours to Date object.
Date.addHours(numberOfHours)

// Add specified number of Minutes to Date object.
Date.addMinutes(numberOfMinutes)

// Add specified number of Seconds to Date object.
Date.addSeconds(numberOfSeconds)

This sample demonstrates selecting a Start Date and automatically advancing the End Date seven (7) days.

 

Download samples

See Also

ClientSelectionChangedFunction | ClientCalendarDisplayFunction