Handling Date and String Conversion with Effect Schema
I feel like I may have hit a limitation with Effect schema or I am just not doing this correctly. Essentially I am trying to have a Schema which takes a
BUT what I get from the
https://effect.website/play/#19db4f36eb35 - I hit a snag which was the Encoded type will be
If what I am trying to do isn't possible, is there a way to force this to Encoded TS type to a Date somehow inside the transformOrFail method
---
But basically looks like this:
Date | string -> decode -> Utc -> encode -> Date BUT what I get from the
Date | string -> decode -> Utc -> encode -> Date | string (which makes sense) https://effect.website/play/#19db4f36eb35 - I hit a snag which was the Encoded type will be
Date | string (assuming this is how the transformOrFail infers). When in fact, the value itself will ALWAYS be a Date. If what I am trying to do isn't possible, is there a way to force this to Encoded TS type to a Date somehow inside the transformOrFail method
---
But basically looks like this:
