fix get selected date from db