Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10728

Slight enhancement to groovy-dateutil extensions

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.5
    • None
    • None

    Description

      For Calendar and Date, we allow getAt access using the Calendar static constants like YEAR, MONTH, etc.

      This gives us multi-assignment for free, e.g.:

      (_E, Y, M, _WY, _WM, D) = Calendar.instance
      

      Here we might be interested in just the YEAR, MONTH and DATE/DAY_OF_MONTH. We can use some dummy variables to capture those as above.

      But it might also be nice to support (like we do for lists for instance) collections of indices:

      (Y, M, D) = Calendar.instance[YEAR, MONTH, DATE]
      

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: