diff --git a/libreplan-business/src/main/java/org/libreplan/business/common/entities/PersonalTimesheetsPeriodicityEnum.java b/libreplan-business/src/main/java/org/libreplan/business/common/entities/PersonalTimesheetsPeriodicityEnum.java index 471fbf1ed..943bd4b79 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/common/entities/PersonalTimesheetsPeriodicityEnum.java +++ b/libreplan-business/src/main/java/org/libreplan/business/common/entities/PersonalTimesheetsPeriodicityEnum.java @@ -162,17 +162,40 @@ public enum PersonalTimesheetsPeriodicityEnum { return name; } + /** + * Returns the start date of the personal timesheet which includes the + * specified date. + */ public abstract LocalDate getStart(LocalDate date); + /** + * Returns the end date of the personal timesheet which includes the + * specified date. + */ public abstract LocalDate getEnd(LocalDate date); + /** + * Returns the number of personal timesheets between the specified dates. + */ public abstract int getItemsBetween(LocalDate start, LocalDate end); + /** + * Returns the date of the personal timesheet in the position specified by + * item taking into account the fromDate. + */ public abstract LocalDate getDateForItemFromDate(int item, LocalDate fromDate); + /** + * Returns the date of the previous personal timesheet to the one which + * includes the specified date. + */ public abstract LocalDate previous(LocalDate date); + /** + * Returns the date of the next personal timesheet to the one which includes + * the specified date. + */ public abstract LocalDate next(LocalDate date); } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/MonthlyTimesheetDTO.java b/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/MonthlyTimesheetDTO.java index c02e0fe20..f6c9b348d 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/MonthlyTimesheetDTO.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/MonthlyTimesheetDTO.java @@ -95,6 +95,10 @@ public class MonthlyTimesheetDTO { return toString(periodicity, date); } + /** + * Returns a string representing the personal timehseet in a given + * date depending on the periodicity. + */ public static String toString(PersonalTimesheetsPeriodicityEnum periodicity, LocalDate date) { switch (periodicity) { case WEEKLY: