I'm trying to get a calendar form field to display without using XML. For previous versions, I called JHTML::_('behavior.calendar') and initialized it with Calendar.setup({args}) that would pass arguments like firstDay, size, ... and render a input type=text and a button.

So, I wanted to add a check for versions > 3.7 to include the new Joomla calendar that has time and all the fine things I need. The problem arises because that calendar's controls are dynamic, as in, a user can choose to display the showTime for example. But I can't even find any usable info on it.

I tried with both Calendar.setup() and JoomlaCalendar.setup({}). That's throwing a function not defined. So I added jimport('joomla.html.html'). Didn't work. So I thought I'd maybe pass them as attributes to the call of calendar. Still didn't work. For reference, I'm displaying the calendar with echo JHTML::_('calendar', defaultValue, name, id, $attributes), or however it goes.

I'd appreciate any pointers.

  • If anyone was ever to stumble upon this and can't find a way, check out this – Chupacabra Feb 5 '18 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.