Happy 15 August - Sizzling Summer Sale - 30% OFF. Coupon: 73RDINDEPENDENCEDAYGrab the Deal

Welcome, Guest
Username: Password: Remember me

Need a new feature in Astroid?

Submit feature requests on github and help improve Astroid.

Submit Now

TOPIC: Appointment Form - different time pick for Saturday

Appointment Form - different time pick for Saturday 11 months 4 days ago #8304

  • pete
  • pete's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 1
  • Karma: 0
I want to modify the Appointment form to reflect the clinic's opening hours:
Mon-Fri 9am-5pm
Sat 9am-1pm
I was able to restrict the date to Mon-Sat, and starting date for tomorrow, using the date's advanced settings:

I was able to restrict the time using the similar steps:

I created another time called Sat-time, which I restricted the hours to 9am-1pm.

The idea is, to have the the "Time" to show when it is Mon-Fri and "Sat-time" when it is Saturday.
I'm trying similar method as when you select departments and doctors...
In date field, I'm trying to have this event:
If date=Sat, then hide "time" and show "Sat-time"
if date=Mon,Tue,Wed,Thu,Fri then show "time" and hide "Sat time".
When I open the events tab in the of the date picker, I don't know how to extract the value of Saturday for it to work...

any ideas how to make it work?
or any other work-around?

The administrator has disabled public write access.

Appointment Form - different time pick for Saturday 11 months 2 days ago #8347

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 2747
  • Thank you received: 415
  • Karma: 85
Hi Pete,

I had a look at this and I don't think it will work using the ChronoForms Events tab, since the value(s) you provide in there will always be static.

Think of it this way, The value of the actual field returned will be 2018-09-17 (or whatever your date format is) but you will be checking it against a static value (Saturday or 06 or something along the lines) so it will never match.

The way I think this is possible is to write some custom javascript that will do the following:
a. get the value of the datepicker field using jquery onchange event.
b. parse the value into jquery's date function to check if the date parsed is a saturday or week day.
c. Hide/Show the particular fields (time picker) based on the day returned from the above.

I really wish I could provide you with the Javascript for the above, but this is way beyond my current level of expertise in Javascript.

Hope this helps Pete.

Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.
Time to create page: 0.232 seconds

Happy Independence Day
Save Flat 30%

Celebrate Liberty with The Sizzling Summer Sale - Coupon: 73RDINDEPENDENCEDAY