amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.02k forks source link

Pickadate throws an error #1160

Closed laacz closed 5 years ago

laacz commented 5 years ago

When using only pickadate (without pickatime), translation lv_LV.js throws an exception, since it tries to extend non existant object object.

Uncaught (in promise) TypeError: Cannot read property 'defaults' of undefined at lv_LV.js?v=3.6.2:20

Here:

image

Removing extend fixes problem.

DanielRuf commented 5 years ago

Hi @laacz,

all translation files have the same logic.

https://github.com/amsul/pickadate.js/blob/master/lib/translations/bs_BA.js

Also see https://github.com/amsul/pickadate.js/pull/1041#issuecomment-479599098 and https://github.com/amsul/pickadate.js/pull/744#issuecomment-479598406

laacz commented 5 years ago

@DanielRuf, but what if I do not require pikatime? Then there is no way to make this work witout mandatory import of pickatime?

DanielRuf commented 5 years ago

You can create a empty object using the following:

jQuery.fn.pickatime = {defaults:{}}

laacz commented 5 years ago

OK. Thanks. Is it not going to be fixed then? If so, then please close the issue :)

DanielRuf commented 5 years ago

Development focus is currently on v5 so v3 will not receive any big changes except critical things like the regression in Chrome 73.