Fixed the bug for the date picker