Preload datepicker lang file and always apply dateFormat defaults (fix #1985)

영어를 예외처리하지 않도록 하여, 영어에서만 날짜 포맷이 다르게 지정되는 문제 수정
This commit is contained in:
Kijin Sung 2022-10-30 17:08:57 +09:00
parent dca06a778d
commit 7493fe14fc
3 changed files with 9 additions and 9 deletions

View file

@ -1,3 +1,4 @@
jquery-ui.min.js
jquery-ui.min.css
i18n/datepicker-{$lang_type}.js
rx_datepicker.js

View file

@ -2,12 +2,11 @@
* @brief Load i18n file of datepicker
* @author MinSoo Kim <misol.kr@gmail.com>
**/
if(typeof current_lang !== "undefined" && current_lang !== 'en') {
jQuery.getScript(request_uri + "common/js/plugins/ui/i18n/datepicker-"+ current_lang.replace("jp", "ja") +".js", function() {
var default_option = {
dateFormat:'yy-mm-dd'
};
jQuery.extend(jQuery.datepicker.regional[current_lang.replace("jp", "ja")],default_option);
jQuery.datepicker.setDefaults( jQuery.datepicker.regional[current_lang.replace("jp", "ja")] );
});
}
(function($) {
var datepicker_lang = (typeof current_lang !== 'undefined') ? current_lang.replace('jp', 'ja') : 'en';
var default_options = {
dateFormat: 'yy-mm-dd'
};
$.extend(jQuery.datepicker.regional[datepicker_lang], default_options);
$.datepicker.setDefaults(jQuery.datepicker.regional[datepicker_lang]);
})(jQuery);