src/main/java/seedu/address/model/parcel/DeliveryDate.java
private Date formatDate(String inputDate) throws ParseException {

        for (String formatString : VALID_STRING_FORMATS) {
            DateFormat df = new SimpleDateFormat(formatString);
            df.setLenient(false);
            try {
                return df.parse(inputDate);
            } catch (ParseException e) {
                logger.info("Failed to fit input delivery date in current format, trying next format...");
            }
        }

        logger.warning("Exhausted all formats, not a valid input.");

        throw new ParseException(inputDate, 0);

    }
/**
     * Formats the input date according to the list VALID_STRING_FORMATS and returns it.
     */
Formats the input date according to the list VALID_STRING_FORMATS and returns it.
Formats the input date according to the list VALID_STRING_FORMATS and returns it .
private Date formatDate(String inputDate) throws ParseException {
        for (String formatString : VALID_STRING_FORMATS) {
            DateFormat df = new SimpleDateFormat(formatString);
            df.setLenient(false);
            try {
                return df.parse(inputDate);
            } catch (ParseException e) {
                logger.info("Failed to fit input delivery date in current format, trying next format...");
            }
        }
        logger.warning("Exhausted all formats, not a valid input.");
        throw new ParseException(inputDate, 0);
    }
private Date formatDate ( String inputDate ) throws ParseException { for ( String formatString : VALID_STRING_FORMATS ) { DateFormat df = new SimpleDateFormat ( formatString ) ; df . setLenient ( false ) ; try { return df . parse ( inputDate ) ; } catch ( ParseException e ) { logger . info ( "Failed to fit input delivery date in current format, trying next format..." ) ; } } logger . warning ( "Exhausted all formats, not a valid input." ) ; throw new ParseException ( inputDate , 0 ) ; }
Formats the input date according to the list VALID_STRING_FORMATS and returns it.
Formats the input date according to the list VALID_STRING_FORMATS and returns it .