jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-164

Date/Calendar operations

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-3
  • Fix Version/s: 1.1-rc-3
  • Component/s: groovy-jdk
  • Labels:
    None

Description

Increment/Decrement operations and ranges on dates, should allow for units other than hours.

counter = date.byWeek()
counter += 10

today.step(nextWeek, Calendar.HOUR, 5)

  • Options
    • Show All
    • Show Open

Sub-Tasks

1.
Provide unit tests for date/time support Sub-task Closed Closed Paul King
 

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Guillaume Laforge added a comment - 08/Dec/05 4:54 AM

Some new ideas on this front, triggered by a similar support in Ruby on Rails.
We could create a "duration" notion that could be used on numbers and allow arithmetic with those durations.

def date = new Date()
date + 3.weeks + 1.day + 2.jours + 5.minutes

3.hours.fromNow
2.days.ago

Thread.startIn( 5.minutes ) { ... }

Timer.every( 45.seconds ) { ... }

Show
Guillaume Laforge added a comment - 08/Dec/05 4:54 AM Some new ideas on this front, triggered by a similar support in Ruby on Rails. We could create a "duration" notion that could be used on numbers and allow arithmetic with those durations. def date = new Date() date + 3.weeks + 1.day + 2.jours + 5.minutes 3.hours.fromNow 2.days.ago Thread.startIn( 5.minutes ) { ... } Timer.every( 45.seconds ) { ... }
Hide
Permalink
Stephen Colebourne added a comment - 21/Sep/06 6:19 AM

Time is a complex domain area. So, could I suggest that the Date and Calendar classes are so poor, slow, and unreliable that you should really think about using the complete rewrite that is Joda-Time - http://joda-time.sourceforge.net.

Stephen Colebourne
Project lead - Joda-Time

Show
Stephen Colebourne added a comment - 21/Sep/06 6:19 AM Time is a complex domain area. So, could I suggest that the Date and Calendar classes are so poor, slow, and unreliable that you should really think about using the complete rewrite that is Joda-Time - http://joda-time.sourceforge.net. Stephen Colebourne Project lead - Joda-Time
Hide
Permalink
Guillaume Laforge added a comment - 13/Feb/07 11:11 AM

The issue might be updated a little to reflect the work you've done on date/time support.

Show
Guillaume Laforge added a comment - 13/Feb/07 11:11 AM The issue might be updated a little to reflect the work you've done on date/time support.
Hide
Permalink
Guillaume Laforge added a comment - 06/Oct/07 4:58 PM

See the date and time category.

Show
Guillaume Laforge added a comment - 06/Oct/07 4:58 PM See the date and time category.
Hide
Permalink
Jörg Gottschling added a comment - 26/Dec/07 5:16 AM

+1 on Stephens suggestion; use joda time!

Show
Jörg Gottschling added a comment - 26/Dec/07 5:16 AM +1 on Stephens suggestion; use joda time!
Hide
Permalink
Guillaume Laforge added a comment - 26/Dec/07 6:29 AM

There's already some additional Data / Time support in Groovy if you use the Date / Time categories:

http://groovy.codehaus.org/JN0545-Dates

Show
Guillaume Laforge added a comment - 26/Dec/07 6:29 AM There's already some additional Data / Time support in Groovy if you use the Date / Time categories: http://groovy.codehaus.org/JN0545-Dates

People

  • Assignee:
    John Wilson
    Reporter:
    Yuri Schimke
Vote (0)
Watch (0)

Dates

  • Created:
    27/Jan/04 11:51 AM
    Updated:
    26/Dec/07 6:29 AM
    Resolved:
    06/Oct/07 4:58 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.