User tests: Successful: 0 Unsuccessful: 0
Pull Request for Issue # .
The old Dynarch DHTML date picker had a setup option 'electric' which stopped the date input field from updating until a specific date was picked. This was not implement in the new joomla.calendar. This PR reinstates this functionality and adds support for it into JFormFieldCalendar
The reason its important is that calendar/event components will have javascript events triggered off changes in date fields - if these are changed spuriously as the date picker is navigated it can lead to unforseen/unplanned for outcomes such as date validation errors or incorrect data entry.
Edit/create and article, go to the publishing tab and click the date picker button for the start date. Navigate the months and years and notice that the date picker field changes value. This is the 'electric; behaviour in action.
Edit the file administrator/components/com_content/models/forms/article.xml and add
electric="false"
to the publish_up field at line c. 166 and repeat step 1.
electric="true"
to the publish_up field at line c. 166 and repeat step 1.
Date input field changes value as you navigate.
Date input field does NOT change value as you navigate.
Date input field changes value as you navigate.
Date input field changes value as you navigate.
Date input field changes value as you navigate.
Date input field changes value as you navigate.
In fact the joomla.calendar javascript has the 'electric' behaviour hard coded in.
Not sure if 'electric' is the best parameter name/description - its just that is what the old calendar used.
Status | New | ⇒ | Pending |
Category | ⇒ | Layout Libraries JavaScript |
Shouldn't this just be the default functionality rather adding it as an option?
What I'm adding is the option to turn off the default functionality.
@C-Lodder should this PR be tested?
Yup I suppose it can be tested. @dgt41 calendar is your baby....you happy with this?
Haven't tested it, but code looks fine.
PS: not my baby, now it's our baby
I have tested this item
With and -out PR: Changed administrator/components/com_content/models/forms/article.xml
by appending electric="false"
Date input Field changes value as navigating.
Franz, copy the code from calendar.js
to calendar.min.js
or test in debug mode. The minified file wasnt commited :)
Can we please name this parameter something better than electric? This is confusing
@dgt41 it’s fixing a BC break so can’t really change it can we?
I have tested this item
Changed given xml + applied PR:
electric="false"
: Date input field does NOT change value as navigate.electric="true"
: Date input field changes value as navigate.@C-Lodder Thanks for Help, Test by Debug-Mode.
@GeraintEdwards, please could you commit the minified JS file?
it’s fixing a BC break so can’t really change it can we?
I'm not pointing at the js side but at the php were we didn't have this parameter. So the xml can have something more meaningful (if we can up with a better naming)...
What about "auto-update" instead of electric?
I agree wholeheartedly that "electric" is a rubbish descriptor and since it hasn't been used in the xml file before now its the right time to choose the better name.
Labels |
Added:
?
|
@GeraintEdwards sorry that it took so long to respond. Is this pr still valid for Joomla 3 or 4?
Had a look on the current J4 behavior and it still updates the input on navigation. So can you rebase this pr to the 4.2-dev branch as the calendar field got rewritten there? In the meantime I'm closing it, when ready please reopen. Thanks for your help making Joomla better.
Additional comment for maintainers, when #37456 got merged then this one here is not needed anymore as the native date input field doesn't update when the calendar is navigated.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-04-04 07:48:21 |
Closed_By | ⇒ | laoneo | |
Labels |
Added:
Conflicting Files
?
Removed: ? |
@dgt41 @C-Lodder For your review pretty please :D