Relative Time + Experimental Code to Translate it?

Both start and end dates are required and you can’t create a column that gives you a now() date (current date and time) because calculated columns will only refresh when the data that they reference changes. Try using =NOW() in a Google Sheet cell. It will give you the current date and time but it will not change until you edit it again. Even if you use it in a formula the only time the formula will recalculate will be if you reference some other data column that changes.

3 Likes

Can I give p1, p2 fixed dates?
Thks.

Yes

Still not

Stupid question, but when I tried to run the code there, it says I require a login: could that be that I just cannot load the “imported luxon” ?

I misunderstood your question, I thought you were going to create two columns with fixed dates and pick them for p1 and p2 parameters. You could pass fixed strings I guess but they would have to be in ISO string date format like this 2021-12-23T14:35:46.700Z or 2020-10-20T10:30:40.000Z

1 Like

Correct, you need to log in to onecomplier.com in order to use URLs in you code.

OK. Where can I find a Date converter to this ISO format? I’m usually DD/MM/AAAA, HH:MM:SS. Thks & Sorry for the trouble. But it’s a side-side project, and we’re on 6 h or more TZ split, so, my apologies for inconvenience & delay, George.

Just use date columns for the two parameters, the conversion will be automatic.

Ahem…

I believe this is an issue that affects several of the Date plugins.

@George-Glide I raised an issue about this a week or so ago.

1 Like

Sorry, I have no idea why it isn’t working for you.

At least we tried. Thks, George.
I’ll let you know if I come up with sth.
As a rule, knowing what the exact format is required would be helpful in fields, Parameter’s placeholders.
Enjoy your week-end :cherry_blossom:

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()