Fixed date not being set to current date if it is empty and changed date format