Gantt add week duration unit

Hi,

Would it be possible to add the unit of duration for weeks? to date there are only minutes, hours and days, it would be very useful to be able to write 2w or 2 weeks to set the duration to 2 weeks (10 days).

Alternatively, is there a way to capture the edit event on the duration so I can see if the user typed a "W" so I can implement the functionality?

Thank you


Best regards,

Matteo


3 Replies 1 reply marked as answer

LA Lokesh Arjunan Syncfusion Team July 4, 2023 11:08 AM UTC

Hi Matteo


Greetings from Syncfusion Support.


We are validating your reported query and we will update you further details within 2 business days July 6th 2023.


Regards,

Lokesh



UA Udhayakumar Anand Syncfusion Team July 6, 2023 12:48 PM UTC

Hi Matteo,


Currently we do not have built-in support for declaring the duration unit as weeks. However, we would like to offer a workaround that can help you achieve your requirement. You can enter the duration in weeks by specifying it as "2 W" (e.g., 2 weeks), which will be automatically converted to the corresponding number of days.


To implement this workaround, we recommend utilizing the actionBegin event with the type set to "save." By capturing this event, you can check if the user has entered a "W" in the duration field and handle the functionality accordingly.


To assist you further, we have prepared a code snippet and a sample link that demonstrate the implementation of this workaround. You can find them below:


Code Snippet:

function actionBegin(args) {

    if (args.type === 'save') {

      var split = args.value.split(' ');

      var num = Number(split[0]);

      num = num * 7;

      var total = num + ' ' + 'days';

      args.value = total;

      args.rowData.Duration = total;

    }

  }

 


Sample Link : https://stackblitz.com/edit/react-o3dvuc?file=index.js,data.js


We have also logged a feature request for the requirement. You can track the status of the feature from the feedback link given below.


Feedback link :  https://www.syncfusion.com/feedback/8367/support-for-month-and-weeks-duration-unit


We have already lined up some major features, we could not implement this support immediately. We will implement this and include it in any of our upcoming releases. Please cast your vote on this feature. Based on the customer demand we will prioritize the features in our upcoming road map. You can communicate with us or track the status of the feature using the feedback link.


Regards,

Udhayakumar


Marked as answer

MA matteomessmer July 7, 2023 01:19 PM UTC

Thank you Udhayakumar.


Best regards,

Matteo


Loader.
Up arrow icon