Ignore:
Timestamp:
Dec 2, 2009, 5:26:54 AM (15 years ago)
Author:
gav
Message:

Make date calculations and formatting more groovy.

Location:
trunk/grails-app/domain
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/InventoryMovement.groovy

    r177 r210  
    1 import java.text.SimpleDateFormat
    2 
    31class InventoryMovement {
    42    InventoryItem inventoryItem
     
    1917
    2018    String toString() {
    21         def date = new SimpleDateFormat("EEE, dd-MMM-yyyy").format(this.date)
    22         "${this.quantity} ${inventoryMovementType.name} on ${date}"
     19        "${this.quantity} ${inventoryMovementType.name} on ${date.format('EEE, dd-MMM-yyyy')}"
    2320    }
    2421}
  • trunk/grails-app/domain/TaskModification.groovy

    r187 r210  
    1 import java.text.SimpleDateFormat
    2 
    31class TaskModification {
    42    Person person
     
    1917
    2018    String toString() {
    21         def date = new SimpleDateFormat("EEE, dd-MMM-yyyy").format(this.date)
    22         "${taskModificationType} on ${date} by ${person}."
     19        "${taskModificationType} on ${date.format('EEE, dd-MMM-yyyy')} by ${person}."
    2320    }
    2421}
  • trunk/grails-app/domain/TaskRecurringSchedule.groovy

    r199 r210  
    11import org.codehaus.groovy.runtime.TimeCategory
     2// the above will be deprecated and replaced by: groovy.time.TimeCategory
    23
    34class TaskRecurringSchedule {
Note: See TracChangeset for help on using the changeset viewer.