Nerian/bootstrap-datepicker-rails

Unlimited Deprecation warnings

Closed this issue ยท 5 comments

After Updateing bootstrap-datepicker-rails from 1.6.4.1 to 1.7.1.1 and new rails 5.1.3 -> 5.1.4 I'm getting the following errors when I'm running my system tests:

DEPRECATED: The language code "kh" is deprecated and will be removed in 2.0. For Khmer support use "km" instead.
DEPRECATED: The language code "kr" is deprecated and will be removed in 2.0. For korean support use "ko" instead.
DEPRECATED: This language code "rs-latin" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian latin support use "sr-latin" instead.
DEPRECATED: This language code "rs" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian support use "sr" instead.

And this is comming for every single test run. I located the source here.

My datepicker is beeing initialized with:

.datepicker({
      format: 'yyyy-mm-dd',
      startView: 1,
      todayBtn: true,
      clearBtn: true,
      language: 'de',
      autoclose: true,
      todayHighlight: true
});

So I'm not using one of those languages.

Hi,

Yeah, that's annoying. I will be gone when 2.0, but on the meantime you could manually select the locales that you wish to include.

Like this:

# Replace this line โ€“ which loads all locales.
//= require bootstrap-datepicker

# For this lines:
//= require bootstrap-datepicker/core
//= require bootstrap-datepicker/locales/bootstrap-datepicker.es.js   # For the spanish locale
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js    # For the french locale
....

Take a look at https://github.com/Nerian/bootstrap-datepicker-rails/tree/master/vendor/assets/javascripts/bootstrap-datepicker/locales in order to see the list of locales.

Ah, I didn't realize.... Thank you.

Rocket speed response. ๐Ÿ˜„ ๐Ÿ‘

@Nerian Thanks for your Tip to silence the deprecated (not needed) languages.
Maybe you can be a bit more precisely in the /Configuration/ - section of the README to make clear to use 'require bootstrap-datepicker' OR 'require bootstrap-datepicker/core + language' ?

@tclaus Sure thing. I updated the readme.