Fixed a JS bug with datetimepicker