Nerian / bootstrap-datepicker-rails

A Datepicker for Twitter Bootstrap, integrated with Rails assets pipeline
MIT License
648 stars 182 forks source link

Unlimited Deprecation warnings #136

Closed casaper closed 6 years ago

casaper commented 6 years ago

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.

Nerian commented 6 years ago

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.

casaper commented 6 years ago

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

casaper commented 6 years ago

Rocket speed response. 😄 👍

tclaus commented 5 years ago

@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' ?

Nerian commented 5 years ago

@tclaus Sure thing. I updated the readme.