@@ -0,0 +1,2056 @@
+package seedu.address.logic.parser;%0A%0Aimport java.time.LocalDate;%0Aimport java.time.LocalDateTime;%0Aimport java.time.LocalTime;%0Aimport java.util.Optional;%0A%0Aimport seedu.address.commons.util.SubstringRange;%0Aimport seedu.address.logic.parser.CommandLineParser.Argument;%0A%0Apublic class DateTimeArgument implements CommandLineParser.ArgumentParser %7B%0A%0A    private final Argument%3CLocalDate%3E dateArg;%0A    private final Argument%3CLocalTime%3E timeArg;%0A%0A    public DateTimeArgument(String dateName, String timeName) %7B%0A        this.dateArg = new Argument%3C%3E(dateName, new DateParser());%0A        this.timeArg = new Argument%3C%3E(timeName, new TimeParser());%0A    %7D%0A%0A    public Optional%3CLocalDate%3E getDate() %7B%0A        return dateArg.isPresent() ? Optional.of(dateArg.getValue()) : Optional.empty();%0A    %7D%0A%0A    public Optional%3CSubstringRange%3E getDateRange() %7B%0A        return dateArg.isPresent() ? Optional.of(dateArg.getRange()) : Optional.empty();%0A    %7D%0A%0A    public Optional%3CLocalTime%3E getTime() %7B%0A        return timeArg.isPresent() ? Optional.of(timeArg.getValue()) : Optional.empty();%0A    %7D%0A%0A    public Optional%3CSubstringRange%3E getTimeRange() %7B%0A        return timeArg.isPresent() ? Optional.of(timeArg.getRange()) : Optional.empty();%0A    %7D%0A%0A    public void setReferenceDateTime(LocalDateTime referenceDateTime) %7B%0A        dateArg.setParser(new DateParser(referenceDateTime.toLocalDate()));%0A        timeArg.setParser(new TimeParser(referenceDateTime.toLocalTime()));%0A    %7D%0A%0A    @Override%0A    public String getName() %7B%0A        return dateArg.getName() + %22 %22 + timeArg.getName();%0A    %7D%0A%0A    @Override%0A    public void reset() %7B%0A        dateArg.reset();%0A        timeArg.reset();%0A    %7D%0A%0A    @Override%0A    public void parse(CommandLineScanner scanner) throws ParseException %7B%0A        try %7B%0A            dateArg.parse(scanner);%0A        %7D catch (ParseException e) %7B%0A            // Okay for now%0A        %7D%0A        try %7B%0A            timeArg.parse(scanner);%0A        %7D catch (ParseException e) %7B%0A            if (!dateArg.isPresent()) %7B%0A                throw e;%0A            %7D%0A        %7D%0A    %7D%0A%0A%7D%0A

implement DateTimeArgument