fix formatting of date value for saving