Customizing Joomla Calendar Setup
Joomla 1.5 has calendar-setup
.js file to setup the joomla calendar as per your requirements.
You can customize jcalendar using a javascript callback functions “param_default”.
Here are some examples customizing your joomla calendar.
Disable all past dates.
Your function where your call the calendar.
function disableDate(d)
{
today = new Date();
difference = d – today;
days = Math.round(difference/(1000*60*60*24));
if( days > -1 )return false;
return true;
}
Now replace the following code from calendar-setup.js
param_default(“disableFunc“, null) ;
toparam_default(“disableFunc“, disableDate) ;
Enable Only Specific Day
function disableDate(d)
{
// Enable only Monday of all months
if( d.getDay()==1 ) return false ;
return true ;
}
Since the changes in
param_default(“disableFunc”, null);
in calendar-setup.js will reflect to all the date fields in your site pages, in order to reflect the customization in specific date field modify above callback function to
if(params.inputField==”custom_date”)
{
param_default(“disableFunc“,disableDate);
}
else
{
param_default(“disableFunc“,null);
}
custom_date is my date text filed name


Hi, i am a newbie to joomla.
I cant find the calendar calling function.
could you please tell me where is should search for calendar calling function
Joomla has HTML Utility class for all HTML drawing classes.
To Displays a calendar control field use this class with calendar method.
void calendar (string $value, string $name, string $id, [string $format = '%Y-%m-%d'], [array $attribs = null])
Example:
JHTML::_(‘calendar’,”, ‘custom_date’, ‘custom_date’, ‘%Y-%m-%d’, array(‘class’=>’inputbox’, ’size’=>’8′, ‘maxlength’=>’19′));
sorry for messing up with my question..
actually i dont know the exact location where to put the following thing
function disableDate(d)
{
today = new Date();
difference = d – today;
days = Math.round(difference/(1000*60*60*24));
if( days > -1 )return false;
return true;
}
Place this JavaScript code in the same view page where your are calling the calendar control.
If your view is default.php , just place this code in default.php.
I hope your will get it.
when i change the calendar-setup.js from
param_default(“disableFunc“, null) ;
to
param_default(“disableFunc“, disableDate) ;
My calendar is not showing up…
media/system/js/calendar-setup.js
ya, i changed it at the place you mentioned.
still no success.
<script>
function disableDate(d)
{
today = new Date();
difference = d – today;
days = Math.round(difference/(1000*60*60*24));
if( days > -1 )return false;
return true;
}
</script>
got the same problem as ganesh no showing calendar!!