From dfe1184c8b56f37ea77ae820aa1240d3faaefebd Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Tue, 28 Aug 2012 12:11:41 +0200 Subject: [PATCH] Improve documentation of new methods in PersonalTimesheetsPeriodicityEnum Also documented method to generate a string representing a personal timesheet in MonthlyTimesheetDTO. FEA: ItEr77S07PersonalTimesheetsPeriodictyConfiguration --- .../PersonalTimesheetsPeriodicityEnum.java | 23 +++++++++++++++++++ .../users/dashboard/MonthlyTimesheetDTO.java | 4 ++++ 2 files changed, 27 insertions(+) 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: