You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/08/25 11:12:00 UTC
[jira] [Resolved] (GROOVY-10728) Slight enhancement to groovy-dateutil extensions
[ https://issues.apache.org/jira/browse/GROOVY-10728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-10728.
--------------------------------
Fix Version/s: 4.0.5
Resolution: Fixed
Proposed PR merged.
> Slight enhancement to groovy-dateutil extensions
> ------------------------------------------------
>
> Key: GROOVY-10728
> URL: https://issues.apache.org/jira/browse/GROOVY-10728
> Project: Groovy
> Issue Type: New Feature
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Fix For: 4.0.5
>
>
> 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.:
> {code}
> (_E, Y, M, _WY, _WM, D) = Calendar.instance
> {code}
> 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:
> {code}
> (Y, M, D) = Calendar.instance[YEAR, MONTH, DATE]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)