Exemple #1
0
  /**
   * Set date for the task
   *
   * @param source from the task that will be edited
   * @param editedTask the task that contains what to edit
   */
  private void setDateTimeBasedOnSpecified(Task source, Task toEditTask, Task editedTask) {
    if (toEditTask.getEndDate() == null || toEditTask.getEndDate() == Task.DATE_NOT_SET) {
      editedTask.setEndDate(source.getEndDate());
    } else {
      editedTask.setEndDate(toEditTask.getEndDate());
    }

    if (toEditTask.getStartDate() == null || toEditTask.getStartDate() == Task.DATE_NOT_SET) {
      editedTask.setStartDate(source.getStartDate());
    } else {
      editedTask.setStartDate(toEditTask.getStartDate());
    }

    if (toEditTask.getStartTime() == null || toEditTask.getStartTime() == Task.TIME_NOT_SET) {
      editedTask.setStartTime(source.getStartTime());
    } else {
      editedTask.setStartTime(toEditTask.getStartTime());
    }

    if (toEditTask.getEndTime() == null || toEditTask.getEndTime() == Task.TIME_NOT_SET) {
      editedTask.setEndTime(source.getEndTime());
    } else {
      editedTask.setEndTime(toEditTask.getEndTime());
    }
  }
Exemple #2
0
 /**
  * Set the task to someday
  *
  * @param editedTask the task to be set to someday
  */
 private void setSomeday(Task editedTask) {
   editedTask.setEndDate(Task.DATE_NOT_SET);
   editedTask.setStartDate(Task.DATE_NOT_SET);
   editedTask.setEndTime(Task.TIME_NOT_SET);
   editedTask.setStartTime(Task.TIME_NOT_SET);
 }