Date picker and code cleanup

fixed the date picker. Removed redundant code that was used to hide the
keyboard on background tap in favour of more efficient code.