List of usage examples for org.joda.time Interval getStart
public DateTime getStart()
From source file:windows.Recursos.java
public static int getActualweek() { // SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy"); DateTime d = new DateTime(); Period weekPeriod = new Period().withWeeks(1); DateTime startDate = new DateTime(d.getYear(), 1, 1, 0, 0, 0, 0); while (startDate.getDayOfWeek() != DateTimeConstants.MONDAY) { startDate = startDate.plusDays(1); }// w ww .j a v a 2 s . c o m DateTime endDate = new DateTime(d); Interval i = new Interval(startDate, weekPeriod); int ct = 0; while (i.getStart().isBefore(endDate)) { i = new Interval(i.getStart().plus(weekPeriod), weekPeriod); ct++; } return ct; }