? ? Pending

User tests: Successful: Unsuccessful:

avatar pinta83
pinta83
1 Sep 2019

/media/system/js/fields/calendar.js at lines 861 and 864 call
date.getOtherFullYear(this.params.dateType, year);

But this function defined in
/media/system/js/fields/calendar-locales/date/jalali/date-helper.js
does not have a second parameter - year, so it can not be changed...

Here's a fix for this issue...

Pull Request for Issue #19926 .

Summary of Changes

Changes 2 lines of code so the picker would work as inteded

Testing Instructions

Create a datepicker input field with attribute maxyear set to -5

Expected result

When the field gets rendered the expected result of the initially displayed year - is the current year -5 years as defined.

Actual result

The year title is ok, but the calendar displayed does not reflect the shown year, but the current month is displayed. When you click the previous year button, you have to click 5 times until it gets to the right year, and then starts working as expected. It also lets you pick the date outside of range. This fixes all these issuse, as the wrong calendar month never gets displayed.

Documentation Changes Required

None

avatar pinta83 pinta83 - open - 1 Sep 2019
avatar pinta83 pinta83 - change - 1 Sep 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Sep 2019
Category JavaScript
avatar pinta83
pinta83 - comment - 1 Sep 2019

Have in mind that the minified version (media/system/js/fields/calendar.min.js - NOT PROVIDED) should be updated aswell

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 Sep 2019

@pinta83 please fill the Template (Summary of Changes
Testing Instructions
Expected result
Actual result
Documentation Changes Required)

avatar pinta83 pinta83 - change - 1 Sep 2019
The description was changed
avatar pinta83 pinta83 - edited - 1 Sep 2019
avatar pinta83
pinta83 - comment - 1 Sep 2019

@franz-wohlkoenig Done.. sry ;)

avatar pinta83 pinta83 - change - 1 Sep 2019
The description was changed
avatar pinta83 pinta83 - edited - 1 Sep 2019
avatar Quy
Quy - comment - 1 Sep 2019

Please use the following tool to compile/include the minified version.
https://skalman.github.io/UglifyJS-online/

avatar pinta83 pinta83 - change - 1 Sep 2019
Labels Added: ?
avatar pinta83
pinta83 - comment - 1 Sep 2019

@Quy Done..

avatar pinta83
pinta83 - comment - 2 Sep 2019

Fixed, tested and updated

avatar richard67 richard67 - test_item - 4 Sep 2019 - Tested successfully
avatar richard67
richard67 - comment - 4 Sep 2019

I have tested this item successfully on 922baab

Hint for other testers: Instead of creating a field, you can modify field "created" in file "administrator/components/com_contact/models/forms/contact.xml" by adding property maxyear="-19" (orn other values). Then create a contact and play with the created date calendar field as described in the testing instructions and the issue.

After having applied the patch e.g. with patchtester, you might have to clear your browser cache in order to use the changed js (or minified js if debug is switched off).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26119.

avatar infograf768
infograf768 - comment - 5 Sep 2019

@dgrammatiko
can you have a look please?

avatar infograf768 infograf768 - test_item - 5 Sep 2019 - Tested successfully
avatar infograf768
infograf768 - comment - 5 Sep 2019

I have tested this item successfully on 922baab


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26119.

avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Sep 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Sep 2019

Status "Ready To Commit".

avatar pinta83 pinta83 - change - 5 Sep 2019
Labels Added: ?
avatar HLeithner
HLeithner - comment - 17 Sep 2019

Thanks for fixing the calendar.

avatar HLeithner HLeithner - change - 17 Sep 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-09-17 16:27:47
Closed_By HLeithner
avatar HLeithner HLeithner - close - 17 Sep 2019
avatar HLeithner HLeithner - merge - 17 Sep 2019

Add a Comment

Login with GitHub to post a comment