List of usage examples for org.joda.time LocalDateTime withDate
public LocalDateTime withDate(int year, int monthOfYear, int dayOfMonth)
From source file:todolist.ui.controllers.SettingsController.java
/** * isWithinWeek// ww w. j a v a2s.c o m * * @param startOfWeek * @param endOfWeek * @param endTime * @return boolean */ private boolean isWithinWeek(LocalDateTime startOfWeek, LocalDateTime endOfWeek, java.time.LocalDateTime endTime) { int millis = 0; int seconds = endTime.getSecond(); int minutes = endTime.getMinute(); int hours = endTime.getHour(); int day = endTime.getDayOfMonth(); int month = endTime.getMonthValue(); int year = endTime.getYear(); LocalDateTime endTimeFormatted = new LocalDateTime(); endTimeFormatted = endTimeFormatted.withDate(year, month, day); endTimeFormatted = endTimeFormatted.withTime(hours, minutes, seconds, millis); return endTimeFormatted.isAfter(startOfWeek) && endTimeFormatted.isBefore(endOfWeek); }