toTime function not working across browsers

Hi WW community and team,

I’m using the toTime formula and, while it appears to work in Chrome on the desktop I’m developing, on Safari (desktop & mobile) and Chrome mobile, the timestamp is showing NaN years ago.

Test #1 shows that the data is being returned by backend when run on Chrome (left) and Safari (right):

Test #2 shows that when the formula is added, it works on Chrome, but not Safari:
image

Is there a configuration I’m missing? Thanks!

Can you try some other string as input and see if they are working correctly:

  • 2022-11-11 17:01:50.575678+00:00
  • 2022-11-11 17:01:50.575678+0000
  • 2022/11/11 17:01:50.575678+00
    It may be related with a bug in safari

for @weweb-team maybe is related to this safari cannot format "2022-09-11 00:00:00 +0800" · Issue #1822 · iamkun/dayjs · GitHub

3 Likes

@dorilama thank you very much for your feedback and guidance.

after looking into this further, we identified the root issue and put in the below fix.

our GraphQL response was the following:
"createdAt": "2022-11-11 17:44:34.934629+00",

but we expected this:
"createdAt": "2022-11-11T17:44:34.934Z",

the fix using javascript to remove the space before feeding into toTime formula:
image

and all fixed on Safari:
image

thank you again. hope the above helps anyone else who encounters this issue.

2 Likes