date.js accepts jQuery object as an argument though it doesn't declare the jQuery library as a dependency. Currently it causes the following error under some conditions.

date.js?v=9.4.0-dev:94 Uncaught ReferenceError: jQuery is not defined
at date.js?v=9.4.0-dev:94

It appears that jQuery is not actually used in that file so we can simply remove it from argument list.

Issue fork drupal-3255504

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Chi created an issue. See original summary.

anagomes’s picture

Assigned: Unassigned » anagomes

anagomes’s picture

Assigned: anagomes » Unassigned
Status: Active » Needs review
anagomes’s picture

Assigned: Unassigned » anagomes
Status: Needs review » Needs work
anagomes’s picture

Assigned: anagomes » Unassigned
Status: Needs work » Needs review
cilefen’s picture

Status: Needs review » Needs work

You have to remove the parameter from the IIFE’s invocation also. I think this code probably does not work in this branch as it is.

cilefen’s picture

There is no test coverage or tests would fail.

anagomes’s picture

Assigned: Unassigned » anagomes
anagomes’s picture

Assigned: anagomes » Unassigned
Status: Needs work » Needs review

Thanks @cilefen! I believe this last commit should solve this.

paulocs’s picture

Status: Needs review » Reviewed & tested by the community

Merge request looks good.
Thanks @anagomes!

alexpott’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 2b1f143 and pushed to 10.0.x. Thanks!
Committed and pushed cddccd7dbd5 to 9.4.x and 3f59ee8a860 to 9.3.x. Thanks!

I think maybe we can completely remove this in D10. Looking at the code I'm not sure that any supported browser would fail:

        // If the browser does not support a native datepicker, add date
        // formatting instructions on date/time fields.
        if (Modernizr.inputtypes.date === false) {

Note sure about our support for Opera Mini - see https://caniuse.com/?search=date

  • alexpott committed 2b1f143 on 10.0.x
    Issue #3255504 by anagomes, Chi, cilefen: Remove jQuery dependency from...

  • alexpott committed cddccd7 on 9.4.x
    Issue #3255504 by anagomes, Chi, cilefen: Remove jQuery dependency from...

  • alexpott committed 3f59ee8 on 9.3.x
    Issue #3255504 by anagomes, Chi, cilefen: Remove jQuery dependency from...
alexpott’s picture

Looking at #3202818: Remove untrue declaration of Opera Mini (in reverse proxy mode) support from Drupal 9.3 we don't support Opera Mini - so I think we can file a follow-up issue to completely remove the library in Drupal 10.0.x and deprecate it in Drupal 9.4.x

cilefen’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.