Bootstrap Datepicker for Mx 6+

0
I'm getting the following error when trying to use the Bootstrap Datepicker in Mx 6.5.1. Is there any quick fix for this? Could not create widget BootstrapDatepicker.widget.BootstrapDatepicker: TypeError: mx.ui.getLocale is not a function
asked
2 answers
2

The Mendix Deprecation Checker gives the following suggestion:

Deprecations:
line:87 // column:19 // deprecation:[ mx.ui.getLocale ]
{
    "match": "    language: mx.ui.getLocale(),",
    "solution": "dojo/_base/kernel.locale"
}

Looks like you should just be able to add a reference to the module "dojo/_base/kernel" and then you can update BootstrapDatepicker.js with the following (assuming you give the module an alias of kernel):

language: kernel.locale,

Full documentation on kernel is available here

Edit: Expanding my answer to include details on adding the module:

Towards the top of BootstrapDatepicker.js, you will see a call to a require function.

The second parameter is an array of modules which will need to be extended. I would keep all the dojo modules together so would add 'dojo/base/kernel' in between 'dojo/base/lang' and 'dojo/text', resulting in:

...'dojo/_base/array', 'dojo/_base/lang', 'dojo/_base/kernel', 'dojo/text',...

The third parameter is a function declaration and the parameters of that function need to match your modules array, so add kernel between dojoArray and lang

...dojoArray, lang, kernel, text,...

The you should be able to update the language property assignment as described above.

answered
0

I opened a Github issue here: https://github.com/ChrisdeG/BootstrapDatepicker/issues/1, they should post the code on Github so someone can make a pull request for it.

answered