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 ...
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 ...
You would have to ...
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 ...
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,
Let's try this:
Drop the format line completely from the xml definition. In its place try:
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 ...
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,...
Sometimes you can't see the forest for the trees.
My JS now looks like this
document.getElementById(target_field).value = currentDate();
and it works !!!
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 ...
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 ...
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 ...
I've found a way to do what you're looking for, but its a bit hacky!
You can achive this behavior with a workaround (testing clicks on popup calendar days):
/* 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 ...
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:
// Id of the input field
inputField: '<?php echo $field->id; ?>',
// Format of the input field