Uploaded image for project: 'Task Management'
  1. Task Management
  2. TASKMGMT-56

Wrong month in tasks stored in JCR

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 1.2.9
    • None
    • None
    • Global Maintenance 4
    • 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.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                thuy.to Thuy To
                jayala Jonathan Ayala
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - Not Specified
                      Not Specified
                      Logged:
                      Time Spent - 1.75d
                      1.75d