Dependent editing on gantt formatacao data ej1


Good afternoon

I'm trying to save a task's date change when editing the dependency. The date being sent to the actionComplete method is
Thu Sep 19 2019 08:00:00 GMT-0300 (Horário Padrão de Brasília)   and I need it to be dd / mm / yyyy.
Can you help me? I have already set dateFormat to dd / mm / yyyy  but when changing it does not accept the format.


Thanks

6 Replies 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team July 17, 2020 01:09 PM UTC

Hi Carmem, 
 
Thank you for contacting Syncfusion support. 
 
In Gantt data, we are using date object for date fields to process date calculations and “dateFormat” API is used to display the date value as per given format on TreeGrid side.  You can convert the dates to your required format using the getFormatedDate() method on actionComplete event. 
The following code snippets share how to achieve this. 
 
actionComplete: function (args) { 
            if (args.requestType === 'save') { 
                var sdate = gantt.getFormatedDate(args.data.StartDate, 'dd/mm/yyyy'); 
                console.log(sdate); 
                var edate = gantt.getFormatedDate(args.data.EndDate, 'dd/mm/yyyy'); 
                console.log(edate); 
            } 
        } 
 
Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 


Marked as answer

CA CARMEM July 17, 2020 01:49 PM UTC

Good Morning

I tried to use it but it gives the error saying that there is no gantt.
I'm using js1 (ej1).




CA CARMEM July 17, 2020 07:54 PM UTC

I created a javascript function and it worked.

Thanks


MS Monisha Sivanthilingam Syncfusion Team July 20, 2020 03:13 PM UTC

Hi Carmem, 
 
Your Welcome. Please contact us if you require any further assistance. 
 
We will wait to hear from you. 
 
Regards, 
Monisha 



CA CARMEM July 21, 2020 04:41 PM UTC

Good afternoon


It worked!

thank you.



MS Monisha Sivanthilingam Syncfusion Team July 22, 2020 05:18 AM UTC

Hi Carmem, 
 
You are welcome. 
 
We are glad to hear that the solution we provided worked. Please contact us if you require any further assistance. 
 
Regards, 
Monisha 


Loader.
Up arrow icon