I’ve been trying to do this:
That’s an tennis app that allows people to create tennis games. Other players can join the game just by clicking an Item list shown in the app retrieving data from Airtable.
I want that, everyday, this table where all the games are, auto-updates and delete the old games, just keeping the new ones.
The data are shown like this:
Dec 1, 2022 and Nov 30, 2022 (and they must stay like this)
Everything went smooth until today, apparently it doesn’t recognize the fact the the 30th of November is smaller than the 1st December.
Any ideas on how i can fix this?
I can make it using the component “seconds since 1970”, adding this information while creating a game, but i’m sure there’s a faster walkaround.
A player creates a game when he clicks the button, but the game is set and played further on (might be in the evening or the day after or in two days).
ex.
I do create a game now at 12.42, 1 Dec 2022 (i can get the seconds from 1970 easily), but i want to play tomorrow.
The value that I store is 2 Dec 2022 (how can i get this value’s “1970 seconds”?)
Seems tricky and right now i can’t find a proper solution
EDIT:
i meant, can i extract the “seconds from 1970” component using a date in the future? The component has just the “end” as block.
From the Date_Input component based on a date in the future, how can i extract the seconds?
For now i found a walkaround, accidentally it has deleted all the data on the first time, hopefully it won’t do it again. I’ve been testing and it seems to work good.
Just posting here in case someone in the future will face a similar problem.
I used the first 3 letters of the Data(the date) that symbolize the month (es. “Nov”). If the month is different from the one we are right now, it automatically deletes the rows.
I think it might be a solution even tho i’m not sure about it.
I’m definitely not an expert at Javascript so I might not be the best person to help you but the general idea is to create a script and upload it to your project. Then, you assign the script .html file to the Web Viewer as its url. And finally, you use the Web Viewer message event blocks to send and receive data from the script. I know that’s just an overview… I wish there was a full tutorial on this but I’m not aware of one.