Issue 20011: Added more date test cases and fixed some bugs.