NSwag icon indicating copy to clipboard operation
NSwag copied to clipboard

Suggestion: Implement support for @js-joda/core date/time handling for full compatibility with NodaTime

Open anthonn opened this issue 2 years ago • 0 comments

In C# a well used nuget is NodaTime. It aims to solve many disadvantages with the built in DateTime. https://www.nuget.org/packages/NodaTime

The entity framework data driver Npgsql for PostgreSql also suggests to use NodaTime https://www.npgsql.org/efcore/mapping/nodatime.html

In Nswag NodaTime maps ok to at least luxon, if an Instant is used (UTC time). But if using something like NodaTime LocalDate (which has no time component), I do not see how this could be mapped in a nice way to either luxon or day.js.

@js-joda/core is not as popular as luxon or day.js, but seems like the best match fontend for NodaTime, and has many advantages compared to thoose libraries. https://www.npmjs.com/package/@js-joda/core

I've managed to configure Nswag to create and parse NodaTime Instant towards Instant in @js-joda/core, but it would be really nice if this was supported "out of the box".

anthonn avatar Jan 15 '24 19:01 anthonn