| Re: Not selectable dates ¶ | |
| Yes, this is possible. You have to provide a function that takes a date and returns that day's status, so that the calendar knows wether to disable it or not. Here's some sample code: function dateStatus(date) {Then you need to include this function at Calendar.setup(), like this: Calendar.setup({The calendar will call this function for each date in a month and, depending on the result, it will take an action on that date: if your function returns true then the date will be disabled, if it returns false then nothing happens and if it returns a string then that string will be appended to the date's CSS class, thus allowing you to have some “special | |
| Re[2]: Not selectable dates ¶ | |
| It sure did !! THNX a lot ! | |
| last |
| Re[2]: Not selectable dates ¶ | |
| This way we have the days blocked for selection but the user can still browse thru all the remaining months. It would be very nice it (for the same example: a camping site) if the not valid months would also be invisible. I could limit the year within the code, I would like to limit the months in an equal way. Somebody has a patch already? | |
| last |
| Re[3]: Not selectable dates ¶ | |
| You are right; and many asked for this. A patch wouldn't be impossible, but it would slow down the calendar generation for any month, which surely isn't desirable. :-( I'll will try to find a way though, but for now you can't do that. | |
| last |
| Re[3]: Not selectable dates ¶ | |
| It looks that user is not only able to browse within disabled days and months, but also selcet those days.. Example: Thanks for help! | |
| last |
| Re[2]: Not selectable dates ¶ | |
| Yeah that prety much works once I got a grip on what it was doing.... | |
| last |
| Re[3]: Not selectable dates ¶ | |
| Hi! I used a similar function to leave only an open window or range of dates... but now I have a strange behavior... Where is the code which calls the selected?? Thanks! | |
| last |
| Re[2]: Not selectable dates ¶ | |
| When I impliment your code suggestion, my variation shown below, I get some strange behavior: Calendar.setup({ The calendar displays fine but instead of dates between today (04/03/2007 in my example) and a year from now (04/03/2008) being selectable, the calendar only allows dates 1 month from now (05/03/2007) to a year + 1 month from now (05/03/2008). Any idea why?
| |
| last |
| Re[3]: Not selectable dates ¶ | |
| Remember that when constructing a new Date() object, the month parameter is the INDEX of the month: 0 = January, 1 = February.... If you're trying to set the date "April 3, 2007", you need to construct it as: new Date(2007,3,3). Or pass it as a formal string: new Date("April 3, 2007"); | |
| last |
| Re[2]: Not selectable dates ¶ | |
| Hello, I have a form with two inputfields for a period. The First one is the from an the secend one is a to date. If the from date is chosen via the calendar I want the to calendar to disable every date < the from date. My code for this looks like this: <div id="content_input_epoch_start_lable" class="text">Von:</div> The disabling works fine, but if a from date is chosen the to calendar will not close after I clicked a date an does not fill a date to the Inputfield, unless I change the month or year (when I step back afterwards it works also fine). Thx for help | |
| last |














