[TASKMGMT-56] Wrong month in tasks stored in JCR Created: 29/Aug/17  Updated: 05/Jan/22  Resolved: 27/Dec/21

Status: Closed
Project: Task Management
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.9

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Thuy To
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 1.75d
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2017-08-29 at 17.07.44.png    
Issue Links:
relation
is related to MGNLWORKFLOW-352 Tasks are stored in wrong folder stru... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Global Maintenance 4
Story Points: 2

 Description   

Hi,

when tasks are stored in JCR nodes, the node corresponding the number of month is wrong (or confusing). That is, for today 29th August 2017, the node structure will be 2017/7/29 instead of 2017/8/29 (see the attached screenshot). This seems to happen due to the behaviour of the method getCurrentDateFolderPath in info.magnolia.task.persistence.TaskPathGenerator which for month it starts by 0 for January.

info.magnolia.task.persistence.TaskPathGenerator.java
/**
     * @return a path in the form <code>/tasks/current_year/current_month/current_day</code>
     */
    protected String getCurrentDateFolderPath() {
        Calendar cal = Calendar.getInstance();

        String year = String.valueOf(cal.get(Calendar.YEAR));
        String month = String.valueOf(cal.get(Calendar.MONTH));
        String day = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));

        return "/" + TasksStore.ROOT_NODE + "/" + year + "/" + month + "/" + day;
    }

Some clients find it confusing and asked for a solution as you could see in the related tickets.

Regards.


Generated at Mon Feb 12 11:02:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.