js: only reset element to altfield if the datepicker is inline