Forums

Date time box

cmwincom 03 Jun, 2012
I am using the latest Chronoforms 4.0 RC3.4.1 on Joomla 2.5.4. What I would like to accomplish in a datetime box is to:
1.) Block weekend days from being selected.
2.) Set the minimum date to the current date or the current date + 1 day (unless it is a weekend date)

I have set a designated the Field Class as datetime_19. I have tried various suggestions from your forums to no success. I have also utilized both date picker types.

I am setting up a form for customers to schedule a service appointment and the days for those appointments are Mon - Fri.

All help is appreciated.

Chris Malley
GreyHead 04 Jun, 2012
Hi Chris,

The code for setting a start date is in this post. At the moment it doesn't look as though either datepicker supports selecting weekdays only :-( The MooTools version does have an option to exclude (or include) specific dates, I guess that this could be used if you aren't looking too far ahead. Otherwise it might be possible to extend the code to add this functionality but that would stretch my JavaScript knowledge a bit.

Bob
GreyHead 11 Jun, 2012
Hi Chris,

That syntax won't work. You just need minDate: new Date() in the DateTime Picker Config box.

Bob
cmwincom 12 Jun, 2012
Thanks. That did it.
cmwincom 12 Jun, 2012
Is there a way to make Sunday the first day on the calendar instead of Monday?
GreyHead 12 Jun, 2012
Hi cmwincom,

Please try startDay: 0 as an option. I think it will work with both datepickers though it's not documented for the MooTools one.

MonkeyPhysics has this note for it:

First day of a week. Can be 0 (Sunday) through 6 (Saturday) - be aware that this may affect your layout, since days in the last column will likely have a style with right-margin: 0px; which would need to be applied to a different day. Default value 1 is Monday.


Bob
jimmyt 09 Dec, 2013

Please try startDay: 0 as an option. I think it will work with both datepickers though it's not documented for the MooTools one.



Can you please specify where would this option be set? I cannot find an option text field in the wizard.

Thanks!
GreyHead 10 Dec, 2013
Hi jtalbot,

The box you need is on the form General tab; click the form name link in the Forms Manager to see it.

Bob
This topic is locked and no more replies can be posted.