I'm using spreadsheetlight for exporting datas to excel. I have time values which defined string and i want to convert or parse to Timespan but spreadsheetlight does not accept Timespan value. How can i define Timespan with spreadsheetlight?
Here is my codes:
var longTimeStyle = Document.CreateStyle();
longTimeStyle.Alignment.Horizontal = HorizontalAlignmentValues.Right;
longTimeStyle.FormatCode = CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern;
for (int i = 0; i < shiftStatus.Count; i++)
{
Document.SetCellStyle(i + 2, 7, longTimeStyle);
//shiftStatus[i].PreperationTime is string
Document.SetCellValue(i + 2, 7, shiftStatus[i].PreperationTime);
}
Here is my solution to this problem:
If you need weeks, months, etc., then develop a method for dividing days and output this result.