Salve,
sono riuscito ad integrare il bootstrap datepicker con questa guida:
http://www.chronoengine.com/faqs/70-cfv5/5201-adding-a-datepicker-for-chronoforms-v5.htmlSolamente che non riesco ad avere questo risultato:
http://www.eyecon.ro/bootstrap-datepicker/#dpd1Ho provato a modificare il codice della guida con questo ma no funziona:
<?php
JHtml::_('jquery.framework');
JHtml::_('bootstrap.framework');
$doc =& JFactory::getDocument();
$doc->addScript('/components/com_chronoforms5/chronoforms/extras/datepicker/js/bootstrap-datepicker.js');
$doc->addStylesheet('/components/com_chronoforms5/chronoforms/extras/datepicker/css/datepicker.css');
$script ="
var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
var checkin = $('#dpd1').datepicker({
onRender: function(date) {
return date.valueOf() < now.valueOf() ? 'disabled' : '';
}
}).on('changeDate', function(ev) {
if (ev.date.valueOf() > checkout.date.valueOf()) {
var newDate = new Date(ev.date)
newDate.setDate(newDate.getDate() + 1);
checkout.setValue(newDate);
}
checkin.hide();
$('#dpd2')[0].focus();
}).data('datepicker');
var checkout = $('#dpd2').datepicker({
onRender: function(date) {
return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : '';
}
}).on('changeDate', function(ev) {
checkout.hide();
}).data('datepicker');
";
$doc->addScriptDeclaration($script);
?>
Grazie in anticipo