Closed qiaozha closed 2 months ago
I think option 1 makes sense at this point of time. We are still some time away from Temporal being widely available and taking in an API closer to it might cause a bit of friction for most customers today. I'm happy to discuss option 2 if anyone feels strongly.
I also think option 1 makes sense for now. Maybe we should just go with option 1.
As confirmed by Timothee in https://github.com/Azure/cadl-ranch/pull/641#discussion_r1700221276, the typespec plainDate is an iso format date string over the json by default and plainTime is the the iso format time string.
Date \| string
Date \| string
For plainDate, the problem is we don't have a direct way get the iso date string and we don't want to import moment.js or date-fns in our SDK, the best we could do is something like
Which doesn't seem to be a good way to be honest.
This is also problematic for plainTime because if we get a string like "13:06:12", we have no way to build a Date type based on that.
Proposal: