Skip to content

Commit e484666

Browse files
committed
Merge pull request #177 from upcom-ch/hotfix/datepicker
fixes issues with datepicker in Contao > 3.3.0 see: #173 (Thanks to dtomasi)
2 parents 413d3fa + dd541e1 commit e484666

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

system/modules/multicolumnwizard/MultiColumnWizard.php

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,9 @@ protected function getMcWDatePickerString($strId, $strKey, $rgxp)
676676
});
677677
</script>';
678678
}
679-
else
680-
{
679+
680+
elseif (version_compare(VERSION,'3.3.0','<')) {
681+
681682
$format = Date::formatToJs($GLOBALS['TL_CONFIG'][$rgxp . 'Format']);
682683
switch ($rgxp)
683684
{
@@ -709,6 +710,42 @@ protected function getMcWDatePickerString($strId, $strKey, $rgxp)
709710
});
710711
});
711712
</script>';
713+
714+
}
715+
716+
else
717+
{
718+
$format = Date::formatToJs($GLOBALS['TL_CONFIG'][$rgxp . 'Format']);
719+
switch ($rgxp)
720+
{
721+
case 'datim':
722+
$time = ",\n timePicker:true";
723+
break;
724+
725+
case 'time':
726+
$time = ",\n pickOnly:\"time\"";
727+
break;
728+
729+
default:
730+
$time = '';
731+
break;
732+
}
733+
734+
return ' <img src="system/modules/multicolumnwizard/html/img/datepicker.gif" width="20" height="20" alt="" id="toggle_' . $strId . '" style="vertical-align:-6px;cursor:pointer;">
735+
<script>
736+
window.addEvent("domready", function() {
737+
new Picker.Date($("ctrl_' . $strId . '"), {
738+
draggable:false,
739+
toggle:$("toggle_' . $strId . '"),
740+
format:"' . $format . '",
741+
positionOffset:{x:-211,y:-209}' . $time . ',
742+
pickerClass:"datepicker_bootstrap",
743+
useFadeInOut:!Browser.ie,
744+
startDay:' . $GLOBALS['TL_LANG']['MSC']['weekOffset'] . ',
745+
titleFormat:"' . $GLOBALS['TL_LANG']['MSC']['titleFormat'] . '"
746+
});
747+
});
748+
</script>';
712749
}
713750
}
714751

0 commit comments

Comments
 (0)