6

When no filter is specified for a calendar field, the system will automatically apply the 'user_utc' filter. According to Joomla!'s documentation, this filter, "calculates the specified value to the time of Greenwich, according to the user time zone settings." In this case, no timezone adjustment was necessary as the date was already in the appropriate ...


3

I would guess there's an implicit timezone conversion happening. It's saving the time as midnight GMT in the DB, but on re-display, it's converting it to local time.


2

This is supported directly in core Joomla, at lease in version 3.8.5. JHTML::calendar takes five parameters, the value (date time), element name, element id, date time format and attributes. The attributes element is an associative array and accepts an 'onchange' attribute, which is fired whenever the date or time picker is changed. For your example, you ...


2

Your model successfully returns the HTML produced by the JHtml class call. But that method also loads some JavaScript code into the document head. Since you don't render the full page, that JavaScript isn't returned and never ends up in the browser. So while you have the HTML there, you miss the JavaScript part and thus nothing will work. You would have to ...


2

My suggestion would be, simply change the database field to varchar or text for saving this form field and then the error should be gone. Then you can get back the string format date values from the database when you need them and you can create any date/datetime format output from the string date that you get from the database. I suggest this, since with ...


2

I noticed a change in the calendar widget in Joomla 3.8. In addition to the setting the value via val(), I also had to set the data-alt-value attribute as well. Otherwise it would fail validation. So, in your example, jQuery('#rq_form input[name=sdate]').val(dateValue); jQuery('#rq_form input[name=sdate]').attr('data-alt-value',dateValue);


1

Let's try this: Drop the format line completely from the xml definition. In its place try: translateformat="true" showtime="true" and see what that gives you. My guess here is the system is ignoring the time section of your format string because you haven't told it that the calendar field should include a time (the showtime parameter). I also think the ...


1

After testing this issue few times, you can realize that via the ajax call the Calendar HTML fields are created but it will not trigger the JoomlaCalendar javascript methods which are needed to create this field fully functional. So this is how it worked for me by creating a new JoomlaCalendar object from the loaded HTML fields: you need to create a simple,...


1

Sometimes you can't see the forest for the trees. My JS now looks like this function addDate(target_field) { document.getElementById(target_field).value = currentDate(); document.getElementById(target_field).focus(); document.getElementById(target_field).blur(); } and it works !!!


1

Here's the glaring issue that I can detect via Google Chrome's developer tools... You have multiple instances of the element id (one nested inside another) that you are attempting to access. id attributes need to be unique on a document. I strongly urge you to make the the necessary changes to make the id attributes unique before progressing with your ...


1

The basic issue is that sql datetime field format is this: 'YYYY-MM-DD HH:MM:SS'. You can only save a date in this format when you save a date/time value (in MySQL at least). If you have a calendar html input field (a DatePicker) and because of a language (country) you have to change the format of the date (for example to this: 'DD-MM-YYYY HH:MM:SS'), then ...


1

After digging around, I finally found the answer or at least got it to work. Not sure if there is a better way. First off, originally I was initializing from the input field. We now have to do it from the parent of the parent node, so the input field must be embedded inside two elements. Secondly, I was originally initializing with the id of the field, we ...


1

I've found a way to do what you're looking for, but its a bit hacky! When you call JHtml::_( 'calendar', . . Joomla renders a div with the class 'field-calendar' into your document, and adds media/system/js/fields/calendar.js to the head. The JavaScript then creates JoomlaCalendar objects called _joomlaCalendar and adds them to all divs with class 'field-...


1

You can achive this behavior with a workaround (testing clicks on popup calendar days): jQuery(".icon-calendar").click(function(){ jQuery("body").on("click",".daysrow",function(){ /* Check input values and do stuff */ }); }); This will check dinamically if .daysrow (the class including all days of the popup calendar) has been clicked, you ...


1

Bakual's answer actually should be accepted, but I just want to show the example of JS code that should be added to the page: <script> jQuery(document).ready(function($) { Calendar.setup({ // Id of the input field inputField: '<?php echo $field->id; ?>', // Format of the input field ifFormat: '<?...


Only top voted, non community-wiki answers of a minimum length are eligible