这部分取决于您所说的“本周”和“下周”的意思…但是使用Joda Time可以很容易地确定它是在“今天”还是“接下来的7天”:
LocalDate event = getDateFromSomewhere();LocalDate today = new LocalDate();LocalDate weekToday = today.plusWeeks(1);LocalDate fortnightToday = weekToday.plusWeeks(1);if (today.compareTo(event) <= 0 && event.compareTo(weekToday) < 0){ // It's within the next 7 days}else if (weekToday.compareTo(event) <= 0 && event.compareTo(fornightToday) < 0){ // It's next week}编辑:要获取周日至周六,您可能需要:
LocalDate startOfWeek = new LocalDate().withDayOfWeek(DateTimeConstants.SUNDAY);
然后执行与上述相同的代码,但相对于startOfWeek。



