Correctly setting date value on change