Better date handling in input fields

See #2