Skip to content
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

It would be convenient if 'date-time' formatted Strings would be typed as JS Dates #209

Open
Henning3110 opened this issue Dec 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Henning3110
Copy link
Contributor

Example: If I want to terminate a Contract, I can schedule the Termination for a specific date. Consider following code:

    client.contract.terminateContract({
        contractId: "some-id",
        data: {
            terminationTargetDate: "10/12/2024",
        }
    })

This example will fail because the terminationTargetDate is not following the ISO 8601, which is used for OpenAPI.

    client.contract.terminateContract({
        contractId: "some-id",
        data: {
            terminationTargetDate: new Date(),
        }
    })

This code is much more convenient for the user. The client could be converting JS Dates to date-time Strings in the background before sending the request.

@Henning3110 Henning3110 changed the title It would be convenient if 'dateTime' formatted String would be types as a JS Date It would be convenient if 'date-time' formatted String would be types as a JS Date Dec 10, 2024
@Henning3110 Henning3110 changed the title It would be convenient if 'date-time' formatted String would be types as a JS Date It would be convenient if 'date-time' formatted Strings would be typed as JS Dates Dec 10, 2024
@LukasFritzeDev LukasFritzeDev added the enhancement New feature or request label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants