- Issue created by @vlooi vlerke
- πΏπ¦South Africa vlooi vlerke
Removing the call for Modernizer reveals more errors
Uncaught TypeError: $context.find(...).once is not a function
line 30: $context.find('input[data-drupal-date-format]').once('datePicker').each(function ()
And
Uncaught TypeError: $(...).find(...).findOnce is not a function
Line:99 $(context).find('input[data-drupal-date-format]').findOnce('datePicker').datepicker('destroy');
- Status changed to Needs review
10 months ago 6:57am 19 February 2024 - πΏπ¦South Africa vlooi vlerke
To Fix: Uncaught ReferenceError: Modernizr is not defined at timeslots.js
Add:
timeslots: js: js/timeslots.js: {} css: theme: css/timeslots.css: {} dependencies: - core/jquery - core/drupal.date + - core/modernizr - jquery_ui_datepicker/datepicker
To: commerce_timeslots.libraries.yml
Clear cache.
This will fix the error but the next error will apper
Uncaught TypeError: $context.find(...).once is not a function
- πΏπ¦South Africa vlooi vlerke
to get rid of
Uncaught TypeError: $context.find(...).once is not a function
change line 30:
$context.find('input[data-drupal-date-format]').once('datePicker').each(function ()
to
$(once('input[data-drupal-date-format]', 'datePicker', context.find)) .each(function () {
This removes the error but it is not fixing the issue. Date picker is not loaded and a user can not select a date.
tried adding - core/once as a dependency but did not work