Fix the bug of date selection