Joomla Datepicker : How to insert in components
Joomla Datepicker

Joomla has its own datepicker built within the Joomla framework for you to use in your components. To insert the datepicker simply put the following code.
<?php
JHTML::_('behavior.calendar');
?>
Then wherever you want to include the datepicker, you can call the following function
<?php
echo JHtml::calendar('date', '%Y-%m-%d');
?>
This will generate a datepicker textbox as below;
So that is how to insert a datepicker within your custom Joomla component or Module. See how easy it is. You can use this datepicker for any kind of a component related to the time and date. For an example, if you are developing a Hotel Reservation Component, you can simply integrate this datepicker for a availability checker or a check-in date selector. One thing I am not happy about this datepicker is that it is not that much beautiful. It will definitely not go with a modern template, so you will have to use some third party datepicker plugin for sure ;) This will be useful if you are not concerned much about the design of the datepicker. Anyway, the scope of this article was only to show the way of adding the built in Joomla datepicker in your custom components. The decision to use it or not will be always up to you :)
Please leave a comment if this post was useful to you.
Joomal great and easy customize development.
ReplyDeleteJoomla Developer
how to stop drag option in calendar
ReplyDeletehow to stop drag option in calendar please tell me the way i am in dead line of my project
ReplyDeletein calendar how to disable before dates form current date. guide me thanks in advace
ReplyDeleteSorry for bothering...but where do I have to insert the code above?
ReplyDeleteI want to integrate it in my Joomla contact form.
Hi Anonymous,
DeleteThank you for the comment. Actually this is used when creating your own custom component. I don't recommend you to make changes to the module you are currently using. You should find a module which has a datepicker in it
Wonderful blog posting on joomla datepicker. Thanks for sharing us!!! I I like it
ReplyDelete