Currently I have two date pickers in my form and working.
I would like to get the second date picker to start with the date chosen in the first datepicker.
So far I have managed to find 'openLastView' in the MooTools Datepicker Librarybut i'm unable to get it to work.
So far I have (datepicker2 = second datepicker class)
What's the correct santax get this working?
I would like to get the second date picker to start with the date chosen in the first datepicker.
So far I have managed to find 'openLastView' in the MooTools Datepicker Librarybut i'm unable to get it to work.
So far I have (datepicker2 = second datepicker class)
datepicker2::{openLastView: 'true'}
What's the correct santax get this working?
Hi TerryWest,
I had a little explore of the RangePicker version of the MooTools datepicker and wondered if this does what you need? See the image below and a test form here
The test form is created using a text input with the id date_range and this code in a Load JS action in the On Load event:
Bob
PS You can change the column setting up to a maximum of 5 if needed. This will select a few weeks or a several years.
Unfortunately the CSS that comes with the DatePicker only supports the Range Picker in the default style-sheet. The other styles would need to be extended to add the extra columns and the footer :-(
I had a little explore of the RangePicker version of the MooTools datepicker and wondered if this does what you need? See the image below and a test form here
The test form is created using a text input with the id date_range and this code in a Load JS action in the On Load event:
<?php
JHTML::_('behavior.mootools');
$picker_array = array(
'Picker.js',
'Picker.Attach.js',
'Picker.Date.js',
'Picker.Date.Range.js',
'Locale.en-GB.DatePicker.js'
);
$doc =& JFactory::getDocument();
foreach ( $picker_array as $v ) {
$doc->addScript(JURI::base().'components/com_chronoforms/js/datepicker_moo/'.$v);
}
$doc->addStyleSheet(JURI::base().'components/com_chronoforms/js/datepicker_moo/datepicker.css');
$doc->addStyleDeclaration("
.datepicker tr, .datepicker td {
border:none;
}
");
?>
var dp, date_range;
window.addEvent('domready', function() {
date_range = $('date_range');
dp = new Picker.Date.Range(date_range, {
pickerClass: 'datepicker',
columns: 2,
minDate: new Date()
});
});
Note: Joomla! isn't too good at handling the order in which scripts get loaded in the header so the first half of this code is about fixing that :-(Bob
PS You can change the column setting up to a maximum of 5 if needed. This will select a few weeks or a several years.
Unfortunately the CSS that comes with the DatePicker only supports the Range Picker in the default style-sheet. The other styles would need to be extended to add the extra columns and the footer :-(
This topic is locked and no more replies can be posted.