#1709 Generate C# TimeSpan as a DayJs duration #1714
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempt to generate a Dayjs duration for a C# TimeSpan.
See #1709
Im not familiar with the code however I wanted to attempt to help out.
DayJS duration takes a ISO 8601 string or an object as a constructor.
I chose to use a function to convert the 'D.HH:mm:ss.SSS' string to the object.
Im not sure if that is a good idea or if converting it to a ISO 8601 and passing that to the constructor would be more reusable.
Copilot suggests the following conversion function:
It would be best if the conversion function would be added as a function to the file as a utility which can then be called in the generated classes instead of inlined like i did here.
But im not sure how to do this and i hope someone can pick this up and polish it up.