Forums / Cotonti / Development / DHTML Js Calendar

A friendly GUI to fill date fields

donP
#24441 2010-05-03 20:15
Could you show us the simpler manner to implemet datepicker from now? I saw this code:
// Update three select controls to match a datepicker selection 
function updateSelected(dates) { 
    $('#selectedMonth').val(dates.length ? dates[0].getMonth() + 1 : ''); 
    $('#selectedDay').val(dates.length ? dates[0].getDate() : ''); 
    $('#selectedYear').val(dates.length ? dates[0].getFullYear() : ''); 
    checkLinkedDays(); // Disable invalid days 
} 
 
$('#selectedPicker').datepick({ 
    minDate: '01/01/2001', maxDate: '12/31/2010', 
    alignment: 'bottomRight', onSelect: updateSelected, 
    showTrigger: '#calImg'}); 
 
// Update datepicker from three select controls 
$('#selectedMonth,#selectedDay,#selectedYear').change(function() { 
    $('#selectedPicker').datepick('setDate', new Date( 
        $('#selectedYear').val(), $('#selectedMonth').val() - 1, 
        $('#selectedDay').val())); 
});
but where and how can we insert that in Cotonti without core hacks?

Adn... why you assigned the ticket to Renaissance?
in [color=#729FCF][b]BLUES[/b][/color] I trust
This post was edited by donP (2010-05-03 20:23, 13 years ago)