src/main/java/seedu/taskmanager/model/task/UniqueTaskList.java
/**
     * Compares the starting date and time of 2 event tasks.
     *
     * @return true if 1st event task is earlier than the 2nd event task based
     *         on the startDate and startTime
     * @return false, if otherwise.
     */
Compares the starting date and time of 2 event tasks.
@return true if 1st event task is earlier than the 2nd event task based
on the startDate and startTime
@return false, if otherwise.
Compares the starting date and time of 2 event tasks . @return true if 1st event task is earlier than the 2nd event task based on the startDate and startTime @return false if otherwise .
private boolean isAddEventEarlierAddListIndex(Task toAdd, ReadOnlyTask readOnlyTask) {
        if (toAdd.getStartDate().value.substring(toAdd.getStartDate().value.length() - 2).compareTo(
                readOnlyTask.getStartDate().value.substring(readOnlyTask.getStartDate().value.length() - 2)) < 0) {
            return true;
        } else {
            if (toAdd.getStartDate().value.substring(toAdd.getStartDate().value.length() - 2).compareTo(
                    readOnlyTask.getStartDate().value.substring(readOnlyTask.getStartDate().value.length() - 2)) == 0) {
                if (toAdd.getStartDate().value
                        .substring(toAdd.getStartDate().value.length() - 5, toAdd.getStartDate().value.length() - 3)
                        .compareTo(readOnlyTask.getStartDate().value.substring(
                                readOnlyTask.getStartDate().value.length()
                                        - 5,
                                readOnlyTask.getStartDate().value.length() - 3)) < 0) {
                    return true;
                } else {
                    if (toAdd.getStartDate().value
                            .substring(toAdd.getStartDate().value.length() - 5, toAdd.getStartDate().value.length() - 3)
                            .compareTo(readOnlyTask.getStartDate().value.substring(
                                    readOnlyTask.getStartDate().value.length()
                                            - 5,
                                    readOnlyTask.getStartDate().value.length() - 3)) == 0) {
                        if (toAdd.getStartDate().value.substring(0, toAdd.getStartDate().value.length() - 6)
                                .compareTo(readOnlyTask.getStartDate().value.substring(0,
                                        readOnlyTask.getStartDate().value.length() - 6)) < 0) {
                            return true;
                        } else {
                            if (toAdd.getStartDate().value.substring(0, toAdd.getStartDate().value.length() - 6)
                                    .compareTo(readOnlyTask.getStartDate().value.substring(0,
                                            readOnlyTask.getStartDate().value.length() - 6)) == 0) {
                                return (toAdd.getStartTime().value.compareTo(readOnlyTask.getStartTime().value) < 0);
                            } else {
                                return false;
                            }
                        }
                    } else {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }
    }
private boolean isAddEventEarlierAddListIndex ( Task toAdd , ReadOnlyTask readOnlyTask ) { if ( toAdd . getStartDate ( ) . value . substring ( toAdd . getStartDate ( ) . value . length ( ) - 2 ) . compareTo ( readOnlyTask . getStartDate ( ) . value . substring ( readOnlyTask . getStartDate ( ) . value . length ( ) - 2 ) ) < 0 ) { return true ; } else { if ( toAdd . getStartDate ( ) . value . substring ( toAdd . getStartDate ( ) . value . length ( ) - 2 ) . compareTo ( readOnlyTask . getStartDate ( ) . value . substring ( readOnlyTask . getStartDate ( ) . value . length ( ) - 2 ) ) == 0 ) { if ( toAdd . getStartDate ( ) . value . substring ( toAdd . getStartDate ( ) . value . length ( ) - 5 , toAdd . getStartDate ( ) . value . length ( ) - 3 ) . compareTo ( readOnlyTask . getStartDate ( ) . value . substring ( readOnlyTask . getStartDate ( ) . value . length ( ) - 5 , readOnlyTask . getStartDate ( ) . value . length ( ) - 3 ) ) < 0 ) { return true ; } else { if ( toAdd . getStartDate ( ) . value . substring ( toAdd . getStartDate ( ) . value . length ( ) - 5 , toAdd . getStartDate ( ) . value . length ( ) - 3 ) . compareTo ( readOnlyTask . getStartDate ( ) . value . substring ( readOnlyTask . getStartDate ( ) . value . length ( ) - 5 , readOnlyTask . getStartDate ( ) . value . length ( ) - 3 ) ) == 0 ) { if ( toAdd . getStartDate ( ) . value . substring ( 0 , toAdd . getStartDate ( ) . value . length ( ) - 6 ) . compareTo ( readOnlyTask . getStartDate ( ) . value . substring ( 0 , readOnlyTask . getStartDate ( ) . value . length ( ) - 6 ) ) < 0 ) { return true ; } else { if ( toAdd . getStartDate ( ) . value . substring ( 0 , toAdd . getStartDate ( ) . value . length ( ) - 6 ) . compareTo ( readOnlyTask . getStartDate ( ) . value . substring ( 0 , readOnlyTask . getStartDate ( ) . value . length ( ) - 6 ) ) == 0 ) { return ( toAdd . getStartTime ( ) . value . compareTo ( readOnlyTask . getStartTime ( ) . value ) < 0 ) ; } else { return false ; } } } else { return false ; } } } else { return false ; } } }
Compares the starting date and time of 2 event tasks.
Compares the starting date and time of 2 event tasks .