fixing creation and editing of dates