Hmm… I’m still not able to replicate that odd switch from 10 to 31 and I can’t see any obvious reason for it in the code. My guess is there's some oddity in time zone/and the moment.js library we're using. I’ll open a ticket.
I just tried this on a helloworld flow (from @Anna Geller's ECS demo), and have some more test cases, as well as a perf issue. just writing this up
For reference, this is Google Chrome Version 96.0.4664.110 (Official Build) (64-bit), on Win10, running on cloud.perfect.io
The incorrect results only occur for some months (05-10 - may-oct, inclusive), independent from the year.
When calculating, if the result will be incorrect it takes much longer (2-3 minutes for 12 dates). Correct results come back instantaneously.
Please see attached for the testing I've done. Hope it helps
This is very strange and I still cannot replicate. Can I ask you for a bit more info/investigation?• Have you set your timezone from the user menu or is set at 'Local'? (You can find the timezone selector by clicking on the avatar in the top right corner and then selecting Account Settings and Profile).
• If you explicitly set your timezone to GMT in the user menu, do you still see the odd conversions?
I'm not convinced that the timezone is having an impact here since its from a date time string but I want to rule it out as it's the only thing that I can see that would explain you seeing this issue and me not being able to replicate it.