Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue 694: Fix timespan parsing for invalid iso values #705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

yfa-vagelis
Copy link
Contributor

Issue

In some cases, the cell is formatted as a timespan and the value is generated by a formula, but the result is not a valid timespan. In such situations, XmlConvert.ToTimeSpan will throw a FormatException. It is reasonable to handle these cases by catching the exception.

Solution

Added excpetion handling for FormatException raised by XmlConvert.ToTimeSpan, and moved the related code to a new private method.

@yfa-vagelis yfa-vagelis force-pushed the fix/timespan-parsing-from-formula-694 branch 2 times, most recently from 89dcc7f to 2141aa1 Compare May 4, 2025 13:24
@yfa-vagelis yfa-vagelis force-pushed the fix/timespan-parsing-from-formula-694 branch from 2141aa1 to b6db99e Compare May 4, 2025 13:28
@appel1 appel1 merged commit bd217f6 into ExcelDataReader:develop May 4, 2025
1 check was pending
@appel1
Copy link
Collaborator

appel1 commented May 4, 2025

Seems I'm not very good with the web merge ui. Fixed in a later commit. :|

@yfa-vagelis yfa-vagelis deleted the fix/timespan-parsing-from-formula-694 branch May 4, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants