Class Index | File Index

Classes


Class BTM.UI.DatePicker


Extends BTM.UI.WindowBase.
Calendar-style popup date picker
Defined in: ui.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
BTM.UI.DatePicker(input, options)
Field Summary
Field Attributes Field Name and Description
 
The current "selected" Date
 
The "today" Date
Fields borrowed from class BTM.UI.WindowBase:
open
Method Summary
Method Attributes Method Name and Description
 
Populate the Date Picker with the information for the current Month
 
flip(direction)
Change the Calendar display to a different Month
 
goToDate(year, month, day)
Change the calendar to display a specific date
 
Hide the Date Picker Window
 
Initialize the Date Picker Window
 
Calculate and apply the correct position for the Calendar Window
 
selectDate(cell)
Select a Date by clicking on it
 
Show the Date Picker Window
Methods borrowed from class BTM.UI.WindowBase:
attachWindow, fullScreenResize, hide, init, resizeWindow, show
Event Summary
Event Attributes Event Name and Description
 
keyPress(event)
Listener for key-press event to support Date Picker naviagtion and closing the Date Picker Window
Class Detail
BTM.UI.DatePicker(input, options)
Parameters:
{HTMLElement|String} input
element ID or reference to element of form element to bind to
{Object} options Optional
the options object
{Number|String} options.firstDayOfWeek Optional, Default: 0
the first day of the week for the current locale, either the index starting at 0 (sunday) or the full-string name of the day
{Boolean} options.showWeekNumbers Optional, Default: true
flag to show week numbers in the popup Date Picker
{String} options.dateFormat Optional, Default: '%j%/%n%/%Y%'
the format to use when outputting the Date. See Date#formatDate for template syntax
{Function||Boolean} options.outputHandler Optional, Default: false
Callback to run when a Date is selected, or false to use default (write selected Date to the input element)
{String} options.position Optional, Default: 'br'
Position for the Calendar Window to appear, relative to the Input element. Options are 'br': Bottom Right, 'tr': Top Right, and 'bl' : Bottom Left
Field Detail
{Date} currentDate
The current "selected" Date

{Date} today
The "today" Date
Method Detail
displayCalendar()
Populate the Date Picker with the information for the current Month

flip(direction)
Change the Calendar display to a different Month
var d = new BTM.UI.DatePicker();
d.showCalendar();
d.flip(1); //Change to the next month
d.flip(12); //Change to the same month, 1 year in the future
d.flip(-24); //Change to the same month, 2 years in the past
Parameters:
{Number} direction
number to add to the current Month to select a new Month to display.

goToDate(year, month, day)
Change the calendar to display a specific date
Parameters:
{Number||Date} year
the four-digit Year or a Date Object
{Number} month Optional, Default: 0
the Month to change to (starting at 0)
{Number} day Optional, Default: 1
the Day to change to

hideCalendar()
Hide the Date Picker Window

initCalendar()
Initialize the Date Picker Window

positionCalendar()
Calculate and apply the correct position for the Calendar Window

selectDate(cell)
Select a Date by clicking on it
Parameters:
{HTMLElement} cell
the Table Cell that was clicked

showCalendar()
Show the Date Picker Window
Event Detail
keyPress(event)
Listener for key-press event to support Date Picker naviagtion and closing the Date Picker Window
Parameters:
{Event} event
object

Documentation generated by JsDoc Toolkit 2.1.0 on Tue Feb 03 2009 04:12:53 GMT+1100 (EST)