Ignore:
Timestamp:
May 31, 2010, 1:29:04 PM (9 years ago)
Author:
gav
Message:

Get Task Search filterpane associatedPropertyValues in controller instead of in gsp.
Sort and only get active items for associatedPropertyValues.
Small refator of DateUtilService with new plusYear().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/DateUtilService.groovy

    r476 r552  
    9999
    100100    /**
    101     * Get the date one year in the future.
    102     * @param date The Date object to start with.
    103     * @returns A Date object one year in the future.
     101    * Get the date plus x years.
     102    * @param date The Date object to start with, defaults to today.
     103    * @param plusYears The number of years to add, defaults to 1.
     104    * @returns A Date object adjusted by x years.
    104105    */
    105     public static Date getNextYear(Date date) {
     106    public static Date plusYear(Date date = new Date(), Integer plusYears = 1) {
    106107        use(TimeCategory) {
    107             date + 1.years
    108         }
    109     }
    110 
    111     /**
    112     * Get the date one year ago.
    113     * @param date The Date object to start with.
    114     * @returns A Date object one year ago.
    115     */
    116     public static Date getPreviousYear(Date date) {
    117         use(TimeCategory) {
    118             date - 1.years
     108            date + plusYears.years
    119109        }
    120110    }
Note: See TracChangeset for help on using the changeset viewer.