#143, #94, fix datepicker bugs