Create a date dd/mm/yyyy from a button action

Hello, again.

I realized that the error in this post Show / Hide an element if the Selected Date is before Start of the Day is that what I created as text is not recognized as a calendar date by Adalo, so I can’t put a condition in the context of time.

Does anyone have any idea how I can create a dd / mm / yyyy date from the action of a button that is recognized by the Adalo as a date, exactly like a date from the Date Picker?

Thank you!

1 Like

Hey,
How are you currently offering the date to the user? Does it come from a collection?

Thank you for your reply @JL_LJ
The date must be generated by button action and updated to 2 collections (users and events).
Now the data value is blank and I try to avoid the Date Picker as I can’t avoid past time selection or weekends days.
So, I try to build a custom calendar, with an action per day / per button.

Hi again @JL_LJ

I don’t know if it was clear.
I have created this calendar
Screenshot 06-14-2021 15.59.48

and I want to have actions that creates a date only on some of them.
That date will be updated to a collection.

Thank you.

Hi @ionutilie ,

This is cool. :+1:

1 Like

From my quick test it didn’t work internally trying to create a record.

It did however seem to work fine when using the external API. Which means you could have a custom action to update the record from the Adalo API. A bit of a workaround, and you need to have the element ID (another issue), but it’s there as an option.

1 Like

In fact you might not need element ID, it also returns it in the custom action response if you create a new record.

Custom action → create datetime record
Update current event > new datetime - datetime

Hope that makes sense?

1 Like

Thank you very much @theadaloguy . :pray:
I will close the ticket now since according to your test this is the limit / possibility now.

Have a nice day!
Thank you!

1 Like

Yes, I understand it!
Thank you!

1 Like

I can’t be 100% sure but I had the same issue as you, it just isn’t accepting the format we can use internally.

It seemed we can’t insert the colon required into the field : : internally, but externally we don’t have that restriction.

1 Like

Thank you @theadaloguy
It took me a long time to find the error and now a workaround.
In the end it’s ok.
Adalo can also bring challenges, but if they are overcome, something beautiful can come out …

1 Like

Did you find a workaround? If not PM me, might have a solution. Once tested I can post for everyone in the forum. Just don’t want to spam now with a lot of questions.

Hello again @theadaloguy :pray: and @JL_LJ.
Thank so much for your support!
I just discovered that if an input form is used as a number with the value 18809 it will be converted directly to 7/1/2021, which would be recognized by Adalo as the calendar date.
From 18809 (7/1/2021) it is calculated which date is desired.

Thank you.

gif-data

2 Likes

Hi,
Yes, exactly, and the other way also, if you save dates as number, you can always compare “equal”, “smaller” and so on :slight_smile:.

You can always converte dates to number to compare and then convert to date to save in DB :slight_smile: .

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.