public final void changeStartDate ( LocalDate date , boolean keepDuration ) { requireNonNull ( date ) ; Interval interval = getInterval ( ) ; LocalDateTime newStartDateTime = getStartAsLocalDateTime ( ) . with ( date ) ; LocalDateTime endDateTime = getEndAsLocalDateTime ( ) ; if ( keepDuration ) { endDateTime = newStartDateTime . plus ( getDuration ( ) ) ; setInterval ( newStartDateTime , endDateTime , getZoneId ( ) ) ; } else { /* * We might have a problem if the new start time is AFTER the current end time. */ if ( newStartDateTime . isAfter ( endDateTime ) ) { interval = interval . withEndDateTime ( newStartDateTime . plus ( interval . getDuration ( ) ) ) ; } setInterval ( interval . withStartDate ( date ) ) ; } }
Changes the start date of the entry interval .