| pax.widget.datePick.init = function( | displayField, | | args | ) |
|
Displays a button next to the specified field, that can display the calendar. Simply
Parameters
| displayField | the field we want to attach the date picker to |
| args | optional argument object to pass to the menu function, ie: {} |
- dateFormat - Select a date format, as specified in pax.date, this is the exact format that the standard PHP date libarry uses
- selectedDate - dd-mm-yyyy formatted date to show, in case there is no date in the displayField, default is today
- mondayFirst - boolean to choose if monday is first day of the week, default = true
- dayNum - the day to start on
- monthNum - the month number to start on (0 = jan, 11 = dec)
- yearNum - the full year
- validate - should we validate the date (using the pax validation library)
- guess - should we guess the date using the pax date library
- buttonOffset - object with x, y pixel offset for the button, eq: { x: 6, y: 8 }, would offset the button 6px right, 8px down
Example
<input id='pax.widget.datePick.init.example1' type='text'>
[:.
var example1 = pax.widget.datePick.init( pax.$('pax.widget.datePick.init.example1') );
exampleCleanup = function() {
pax.widget.datePick.destroy( pax.$('pax.widget.datePick.init.example1') );
};
:]
This example shows a simple date picker, with all the default settings
Example
<input id='pax.widget.datePick.init.example2' type='text' value='07-07-2007'>
[:.
pax.widget.datePick.init( pax.$('pax.widget.datePick.init.example2') );
exampleCleanup = function() {
pax.widget.datePick.destroy( pax.$('pax.widget.datePick.init.example2') );
};
:]
This example shows a simple date picker, with all the default settings, and a pre-populated field
Example
<input id='pax.widget.datePick.init.example3' type='text'>
[:.
pax.widget.datePick.init( pax.$('pax.widget.datePick.init.example3'), { selectedDate: '07-07-1988' } );
exampleCleanup = function() {
pax.widget.datePick.destroy( pax.$('pax.widget.datePick.init.example3') );
};
:]
This example shows a simple date picker, with a specified startDate