Hi Andrea,
In Gantt control the start date and end date will be saved as date objects, and we can convert these date objects into any formats before saving it to the database. Can you please share us more details regarding to which format do you want to convert these date objects. Also can you please share us your sample you are trying to de-serialize the date objects , this will be helpful for us to provide you a better solution.
Please let us know if you need further assistance on this.
Regards,
Dinesh kumar.N
Hi Prasanth,
Instead of converting the Global format of the date time object (ex: Thu Dec 10 2015 00:00:00 GMT+1100 (AUS Eastern Daylight Time)) to particular date time format, we can define “DateFormat” property of Gantt control as “MM/dd/yyyy hh:mm:ss tt”, and this format can be saved directly in the SQL table columns.
We have prepared a sample based on your requirement, find the sample from below location.
Sample: https://www.syncfusion.com/downloads/support/forum/120956/ze/MVCsampleSQL-985382851
Also could you please provide information about, from where you have passed the Global format date time object to data source?, so that we can provide a better solution regarding this query.
Please let us know, if you need further assistance on this.
Regards,
Dinesh kumar.N
Hi Prasanthan,
Thanks for your provided information.
We are passing the value of date column with Globalize date format. If we want to save particular format in SQL table then we have to convert it before saving it to the SQL table.
Code Snippet:
[cshtml]
<script type="text/javascript"> function ActionComplete(args) { //... var data = args.data.item; //data.StartDate is in Globala date format. data.StartDate = Globalize.format(data.StartDate, "M/d/yyyy hh:mm:ss tt"); //... } </script> |
We have prepared a sample based on your requirement, find the sample from below location.
Sample: https://www.syncfusion.com/downloads/support/forum/120956/ze/Date_Format-1692846031
Regards,
Dinesh kumar.N