Relative Time + Experimental Code to Translate it?

Do you happen to have a converter to ISO date format? :innocent:, Darren. Just in case.
That could increase my chances to get date columns work. And separate the French translation work once dates are “clean”.

You could extract the component parts from the date using a series of math columns, and then stitch them back together using a template column. But that’s kinda silly. I’d prefer to just wait until the plugins are fixed.

1 Like

:sweat_smile:
Yes, I had a bad feeling about this too :cowboy_hat_face::alien:, according to your comments here and there.
Tricky Business.
Now, do you happen to know if Glide stores the user’s Time Zone? Or do we have to “catch it or lose it”?
Thks

@Darren_Murphy @L.M Do you have a sample app where the dates do not work? The code is assuming that the dates are coming in as iso date strings but apparently, they are not in all cases. I guess I could add some tests on the passed-in variables to see what format they are. I’d be curious to know what the following Code/Javascript column returns

return (typeof p1) + " - " +  p1

I have issues with the Date Plugins in all of my apps. I don’t believe it’s anything to do with the apps, but rather my locale/date settings that cause them to fail or give incorrect results.

Interestingly, that’s being interpreted as a date string in mm/dd/yyyy format. But, my local machine does not use that format. So any results I get are either incorrect (in the case of ambiguous dates - where 11th November is interpreted as 9th September), or they fail (in the case of non-ambiguous dates - where 20th November is interpreted as 11th of the 20th month. ie. an invalid date)

OK, I’ll have to think about this discovery.

What do you get with this:

return new Date().toJSON()

This

Interesting. @L.M That is what I get as well. What do you get when you try the other code below. Use either of the date columns for p1

return (typeof p1) + " - " +  p1

Huh… Like this, George? :thinking:

No. p1 should just be one of your date columns. Also you are missing the “R” in return.

That’s indeed what I tried first, but
BTW, it’s “Return” not “eturn”, no mispelling in the code used, just the screen cap a little late

You’re still missing the r

No

Make it all lower case: return

Aha!


Yes, Sir!
And accurate date/time

Ok, so what Glide is “sending” as the value for any date parameter is dependent on the device’s local date settings. As @Darren_Murphy said we will have an issue with any date passed to plugins or javascript when using dates because the string format changes depending on the local format. There is nothing we can do here to fix it. I’ll report to the Engineers.

4 Likes

Thks, George. Happy to help.
Do you happen to know if Glide stores user’s Time Zone whenever a “current user’s time” is set?
To retrieve if later on.
Thks.

I don’t believe that glide stores the user’s timezone. That needs to be calculated on your end. Obviously several of those options below are plugins, so may or may not work correctly for you, but it gives you a few options to try.

3 Likes

@L.M If you use Google Sheets you could create two columns and use these formulas on row one of each column. Obviously, change the column references to the two date columns. Then use those two columns in your DateDiff p1 and p1 parameters.

={"StartISO";ARRAYFORMULA(IF(LEN(F2:F),TEXT(F2:F,"yyyy-MM-ddTHH:mm:ss.000Z"),""))}
={"EndISO";ARRAYFORMULA(IF(LEN(G2:G),TEXT(G2:G,"yyyy-MM-ddTHH:mm:ss.000Z"),""))}
3 Likes