[Wolves] Php datepicker calendar - choosing dates

Chris Ellis chris.ellis.intrbiz at googlemail.com
Mon Mar 5 16:11:37 UTC 2012


Hi Wayne

On 5 March 2012 15:57, Wayne Morris <waynelists at machx.co.uk> wrote:
> On 05/03/2012 15:44, David Goodwin wrote:
>>>
>>> Can I overide the disabledays with a 'except these' or do i have to do it
>>> some other way?
>>> Also, can I add a 'you haven't changed calendar, have another go' else
>>> they might just choose default.
>>> cheers
>>
>>
>> If I understand your question correctly, you could extend the TC_Calendar
>> class, and define your own 'disabledDay' function … however, this will
>> probably require you to read the source code of the parent (TC_Calendar)
>> class and understand how it's working.
>>
>> David.
>> _____________________
>
> The TC_Calendar function seems to disable an entire column of the calendar,
> so would probably require more fiddling with than I'm capable to re-enable
> only certain dated.
> but thanks.

Why bother with any PHP, just use a Javascript based date picker.
There will be
many JQuery based things, a quick Google, for example:

    http://jqueryui.com/demos/datepicker/

That JQuery based picker, has an event: beforeShowDay which (based on the docs)
would allow you to implement what ever day selection logic you need, eg:

    $('.selector').datepicker({
       beforeShowDay: function(date) { return [ false, 'booked', 'All
days are booked!' ]; }
    });

Also, Javascript shares nothing with Java.  They are entirely separate
and should
never be confused.

Chris



More information about the Wolves mailing list