I have built up a form and using a date field with calendar from chorno forms. I want to have my date field to accept only future dates including today, no past dates, I was searching through forums and found somewhere that there is a parameter called direction for the same like
direction: 1
I tired adding this to date extra fields but this makes calendar to disappear and not working anymore. I know I can use some custom script validation, but just would like to know if there is simpler way by just adding a parameter..?
direction: 1
I tired adding this to date extra fields but this makes calendar to disappear and not working anymore. I know I can use some custom script validation, but just would like to know if there is simpler way by just adding a parameter..?
Hi thewebnsoft,
Try
Bob
Try
classes: ['dashboard'], direction: 1
in the date fields extra boxBob
I mentioned that I already tried this and this make calendar disappear from form.๐
sry, it was my typo, it works but doesn't let me select day today, is there a way to make it select today and future dates.
it works๐ thx a lot.
Hi Bob,
could you please let me know how to setup the date picker only for future dates (starting from tomorrow) in v4 for joomla 1.5.
Looking forward to your reply.
Thank you in advance
Bromm
could you please let me know how to setup the date picker only for future dates (starting from tomorrow) in v4 for joomla 1.5.
Looking forward to your reply.
Thank you in advance
Bromm
Hi Bromm,
There's a thread here over in the CFv4 forum about configuring the date picker. Please upgrqade to CFv4 RC1.8 to get the bug-fixes.
Here's a partial answer: The option you need to add is like this minDate: { date: '10-06-2011', format: 'd-m-Y' }. There's a similar maxDate option as well.
But . . . I can't see any obvious way of making those dates variable with the way that ChronoForms currently does the configuration :-(
I'll try and come back and take another look when I have some time. Meanwhile, there is a possible fix about half-way down the comments at the datepicker docs.
Bob
There's a thread here over in the CFv4 forum about configuring the date picker. Please upgrqade to CFv4 RC1.8 to get the bug-fixes.
Here's a partial answer: The option you need to add is like this minDate: { date: '10-06-2011', format: 'd-m-Y' }. There's a similar maxDate option as well.
But . . . I can't see any obvious way of making those dates variable with the way that ChronoForms currently does the configuration :-(
I'll try and come back and take another look when I have some time. Meanwhile, there is a possible fix about half-way down the comments at the datepicker docs.
Bob
Hey Bob,
thank you so much for your reply.
I have used this solution with a fixed date now....
But of course I would prefer the dynamic/variable solution. I'm waiting for your reply, after you had more time to have a deeper look into that issue.
Kind regards,
Bromm
thank you so much for your reply.
I have used this solution with a fixed date now....
But of course I would prefer the dynamic/variable solution. I'm waiting for your reply, after you had more time to have a deeper look into that issue.
Kind regards,
Bromm
Hi Bromm,
I spent a long time on this yesterday and found a few ChronoForms bugs that I've posted in the bugs list. So far I have failed to get a variable date to work here. I think that it may need a hack to the datepicker code :-(
Bob
I spent a long time on this yesterday and found a few ChronoForms bugs that I've posted in the bugs list. So far I have failed to get a variable date to work here. I think that it may need a hack to the datepicker code :-(
Bob
Hi Bromm,
The good news is that I have found fixes for the bugs and got this working. The bad news is that it's going to take me until tomorrow to write up the fixes and post them.
Bob
The good news is that I have found fixes for the bugs and got this working. The bad news is that it's going to take me until tomorrow to write up the fixes and post them.
Bob
Hi Bromm,
And here is a the code to get a variable future date set as the calendar start date. Add a Load JS Action and put this code in the Code box
Then go to the Form General tab and add
Bob
Notes:
[list=1]This has been tested on Joomla! 1.5 with MooTools 1.2.5 only.
The 'd-m-Y' format is important - I tried other formats and several failed, this one seems to work. It isn't related to the display format or the input/output format which can be set separately. [/list:o]
And here is a the code to get a variable future date set as the calendar start date. Add a Load JS Action and put this code in the Code box
var d_delay = 80;
var startDate = '';
d = new Date();
d.setDate(d.getDate() + d_delay);
var d_month = d.getMonth();
d_month++;
var pad = function(str) {
str = String(str);
return (str.length < 2) ? "0" + str : str;
}
startDate = pad(d.getDate()) +'-'+ pad(d_month) +'-'+ d.getFullYear();
Change the first line to set the delay in days; so 80 means that the first available day is 80 days afer today.Then go to the Form General tab and add
datepick_class::{minDate:{ date: startDate, format: 'd-m-Y' } }
in the DateTime Picker selector box - where datepick_class needs to be changed to match the class of your datepicker.Bob
Notes:
[list=1]
Hi Bob,
thank you so much for finding the solution for me (and others might need it as well)!!!
I just tested the modifications and....it works like a charm!
Thanks again!
Bromm
thank you so much for finding the solution for me (and others might need it as well)!!!
I just tested the modifications and....it works like a charm!
Thanks again!
Bromm
Hey Bob,
I would have another question regarding dates to be show (not shown) in Calender View.
Could you advice how I can make only some days eg. every Tuesday and Wednesday available in Calendar View, but for example block the whole month of October for selection?
I have tried it with the following: availableDates:{2011: {1: [19, 29, 31], 3: [5, 19, 24]}} but this only shows a kind of dropdown list. So I assume this is not correct...
I'm looking forward to your reply and would like to thank you in advance for your efforts.
Kind regards,
Bromm
I would have another question regarding dates to be show (not shown) in Calender View.
Could you advice how I can make only some days eg. every Tuesday and Wednesday available in Calendar View, but for example block the whole month of October for selection?
I have tried it with the following: availableDates:{2011: {1: [19, 29, 31], 3: [5, 19, 24]}} but this only shows a kind of dropdown list. So I assume this is not correct...
I'm looking forward to your reply and would like to thank you in advance for your efforts.
Kind regards,
Bromm
Hi Bromm,
I don't think that 'availableDates' is a valid option for the MonkeyPhysics version of the DatePicker that Max has used (at least I don't see it in the docs there).
It does appear to be in the MooTools version but I haven't yet tried that with ChronoForms - on the to-do list. Even that doesn't appear to support selections like 'every Tuesday & Wednesday' :-(
Bob
I don't think that 'availableDates' is a valid option for the MonkeyPhysics version of the DatePicker that Max has used (at least I don't see it in the docs there).
It does appear to be in the MooTools version but I haven't yet tried that with ChronoForms - on the to-do list. Even that doesn't appear to support selections like 'every Tuesday & Wednesday' :-(
Bob
This topic is locked and no more replies can be posted.