If a date is given, then a new datepicker is created