Added safety check for DATEPICKER_FORMAT