Sharepoint - How to set start and end date in Timeline webpart in SharePoint 2013?

I know that this is a rather older post. I was dealing with the same issue. The Timeline component stores most of the configuration data in a property bag stored off of the RootFolder for the specific Task List.

var list = SPContext.Current.Web.Lists["Tasks"];
list.RootFolder.Properties["TimelineDefaultView"];
list.RootFolder.Properties["Timeline_Timeline"];

You can then take the value from Timeline_Timeline de-serialize it, modify it, then save the serialized XML back into the property bag.

There is an XML node for the timeline options. With the current values available, it seems like your best bet is to create two milestone tasks like "Project Start" and "Project End". The timeline should adjust accordingly.

<options dateFormat="255" panZoomT="9" ProjSummFmt="3" showDates="1" showProjSummDates="1" showToday="1" showTS="1" timelineHeight="110" timelineWidth="-1" timescaleT="8" todayT="10" />

You can read more about my discovery on my blog.

Tags:

Tasks