Current time as minimum time for Date/time picker

I am creating an application for medical center and I need to offer patient to make booking for appointment. And possible appointment intervals should start from current date and current time.
With date is ok - it’s working when I put Minimum Date = Current date/time.
But this is not working with time. And even if current time is 15.00 (3 p.m.), it shows me possibility to book 10.00 or 13.00 (1 p.m.).
Is it possible somehow to have minimum time as current?

You can specify minimum hour and use a decimal hour.

Create a conditional that says if the current date equals the selected date, then set the minimum hour. Then if they select a date after today, there is no minimum hour and they can select any time.

For the minimum hour: current date:extract hour + (current date:extract minute/60). That will limit the time to no earlier than the current time, the conditional only does it for the current day.

I’d send a screenshot but I’m not at my computer.

Hey @dennim75

You can try this solution for storing the start and end times. First, create a field name time with field type date range.

Screen Shot 2022-12-05 at 11.07.42 AM

Then use two date & time Picker elements in order to save start and end time.

Create a workflow on a button when you want to save time.

Screen Shot 2022-12-05 at 11.22.05 AM

Once you save the data in the database. Now again pick the date & time picker element and do the following steps shown in the screenshot to set the start and end date:

end date

If any further assistance is required get in touch with me on:
LinkedIn:- Karamjit Singh - Aprintaa - Rank First To Earn Fast! | LinkedIn
Gmail:- karamwise@gmail.com

1 Like

@kyle1 is spot on here. Condition for date being today and set minimum hour to current hour (round up of you need to).

Can you show me the screenshot with conditional. I couldn’t catch your idea.

You can replace “newTime” in my screenshot with Current date/time in your implementation:

image

So the initial content is set to the current date/time and the minimum date is today.

Then the conditional says if they selected today in the date picker, we should set the minimum hour. If it’s later than today, they can select any hour.

Since we can’t set the minimum minutes, extract the current minutes and divide by 60 minutes to get the decimal hour, extract the current hour, add them up.

I can’t take credit for this, I found it here and sorry, I don’t know who to credit.

1 Like

Yep. It’s working. Great solution.

Thanx a lot!!

Hey @kyle1 and @NigelG

Why does this often result in a completely unselectable date/time picker?

For example:


The time picker component just becomes a decimal of the original time

There is a bug, I’ve been working with support on it. I’ll post more info later. It’s a really weird bug, totally reproducible and only at certain times of the day.

1 Like

Hey Kyle - how’d we go? (If you’re allowed to share)

Sorry for the delay. I was informed it was fixed! I have not yet verified that it is fixed for every minute in the day but I have not seen the issue and customers have not mentioned it recently.

This topic was automatically closed after 70 days. New replies are no longer allowed.