package seedu.tasklist.logic.parser;

import java.util.Date;
import java.util.List;

import org.ocpsoft.prettytime.nlp.PrettyTimeParser;

public class DateParser {

    /**
     * Uses PrettyTime NLP library to parse the dates into a list of Date objects
     */
    public static List<Date> parse (String date) {
        List<Date> dates = new PrettyTimeParser().parse(date);
        return dates;
    }
}

@@ -135,33 +135,328 @@
 r;%0A%0A
-public class DateParser %7B
+import seedu.tasklist.commons.exceptions.IllegalValueException;%0A%0Apublic class DateParser %7B%0A%0A    public static final String NO_DATES_MESSAGE = %22No dates were detected, please enter a valid date after /d.%22;%0A    public static final String EXCESS_DATES = %22Please enter only one date for Deadlines and two dates for Events.%22;
 %0A%0A  
@@ -599,16 +599,45 @@
 ng date)
+ throws IllegalValueException
  %7B%0A     
@@ -694,16 +694,263 @@
 (date);%0A
+        System.out.println(dates.size());%0A        if (dates.isEmpty()) %7B%0A            throw new IllegalValueException(NO_DATES_MESSAGE);%0A        %7D%0A        if (dates.size() %3E 2) %7B%0A            throw new IllegalValueException(EXCESS_DATES);%0A        %7D%0A
         

add error messages for wrong or no dates entered