package seedu.taskman.model.event;

import seedu.taskman.commons.exceptions.IllegalValueException;

/**
 * Represents a Task's deadline in the task man.
 * Guarantees: immutable; is valid as declared in {@link #isValidDeadline(String)}
 */
public class Deadline {

    public static final String MESSAGE_DEADLINE_CONSTRAINTS = "Task deadline should only contain numbers";
    public static final String DEADLINE_VALIDATION_REGEX = "\\d+";

    public final String value;

    /**
     * Validates given deadline number.
     *
     * @throws IllegalValueException if given deadline string is invalid.
     */
    public Deadline(String deadline) throws IllegalValueException {
        assert deadline != null;
        deadline = deadline.trim();
        if (!isValidDeadline(deadline)) {
            throw new IllegalValueException(MESSAGE_DEADLINE_CONSTRAINTS);
        }
        this.value = deadline;
    }

    /**
     * Returns true if a given string is a valid deadline.
     */
    public static boolean isValidDeadline(String test) {
        // TODO: update validation
        return test.matches(DEADLINE_VALIDATION_REGEX);
    }

    @Override
    public String toString() {
        return value;
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof Deadline // instanceof handles nulls
                && this.value.equals(((Deadline) other).value)); // state check
    }

    @Override
    public int hashCode() {
        return value.hashCode();
    }

}

@@ -359,84 +359,439 @@
 ain 
-numbers%22;%0A    public static final String DEADLINE_VALIDATION_REGEX = %22%5C%5Cd+%22;
+dates and times in the format: %5Bthis/next%5D tdy/tmr/mon/tue/wed/thu/fri/sat/sun HHMM.%22;%0A    public static final String DEADLINE_VALIDATION_REGEX = %22((tdy%7Ctmr)%7C(((this)%7C(next))?%5C%5Cs(mon%7Ctue%7Cwed%7Cthu%7Cfri%7Csat%7Csun)))%5C%5Cs(((0%7C1)%5B0-9%5D)%7C(2%5B0-3%5D))(%5B0-5%5D%5B0-9%5D)%22;%0A    // ((tdy%7Ctmr)%7C(((this)%7C(next))?%5Cs(mon%7Ctue%7Cwed%7Cthu%7Cfri%7Csat%7Csun)))%5Cs(((0%7C1)%5B0-9%5D)%7C(2%5B0-3%5D))(%5B0-5%5D%5B0-9%5D)%0A    // Examples: tdy 2359, tmr 0000, mon 0400, this tue 1600, next thu 2200
 %0A%0A  
@@ -864,14 +864,14 @@
 ine 
-number
+string
 .%0A  
@@ -1412,14 +1412,18 @@
 DO: 
-update
+improve on
  val
@@ -1429,16 +1429,27 @@
 lidation
+, see above
 %0A       
@@ -1510,32 +1510,32 @@
 %0A%0A    @Override%0A
-
     public Strin
@@ -1545,24 +1545,104 @@
 oString() %7B%0A
+    %09// TODO: check if direct return of original input without processing is OK%0A
         retu

Update DEADLINE_VALIDATION_REGEX