0.0.318 work with datarangepicker.js
This commit is contained in:
@@ -43,6 +43,52 @@
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
locale_ru = new Object({
|
||||
direction: "ltr",
|
||||
// format: t.localeData().longDateFormat("L"),
|
||||
format: "DD.MM.YYYY",
|
||||
separator: " - ",
|
||||
applyLabel: "Принять",
|
||||
cancelLabel: "Отменить",
|
||||
weekLabel: "Н",
|
||||
customRangeLabel: "Custom Range",
|
||||
|
||||
});
|
||||
|
||||
locale_en = new Object({
|
||||
direction: "ltr",
|
||||
// format: t.localeData().longDateFormat("L"),
|
||||
format: "DD.MM.YYYY",
|
||||
separator: " - ",
|
||||
applyLabel: "Apply",
|
||||
cancelLabel: "Cancel",
|
||||
weekLabel: "W",
|
||||
customRangeLabel: "Custom Range",
|
||||
|
||||
});
|
||||
|
||||
function changeLangForDateTimePicker() {
|
||||
|
||||
if (document.documentElement.lang === 'ru'){
|
||||
locale_lang = locale_ru;
|
||||
lang = 'ru';
|
||||
} else {
|
||||
locale_lang = locale_en;
|
||||
lang ='en';
|
||||
}
|
||||
moment.locale(lang);
|
||||
return locale_lang
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function init_arrival_DT (date=null,single=true,hour=true){
|
||||
let minDate = null
|
||||
if (date){
|
||||
@@ -58,7 +104,9 @@ function init_arrival_DT (date=null,single=true,hour=true){
|
||||
}
|
||||
let place_1 = document.querySelector("#id_arrival_DT")
|
||||
if (place_1) {
|
||||
moment.locale('ru');
|
||||
|
||||
|
||||
|
||||
$(place_1).daterangepicker({
|
||||
"autoapply": true,
|
||||
"linkedCalendars": false,
|
||||
@@ -66,6 +114,7 @@ function init_arrival_DT (date=null,single=true,hour=true){
|
||||
"timePicker":hour,
|
||||
"timePicker24Hour":true,
|
||||
"minDate":minDate,
|
||||
"locale": changeLangForDateTimePicker(),
|
||||
},
|
||||
function (start, end, label) {
|
||||
|
||||
@@ -78,6 +127,7 @@ function init_arrival_DT (date=null,single=true,hour=true){
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(`${place_1.id} .drp-calendar.right`).hide();
|
||||
$(`${place_1.id} .drp-calendar.left`).addClass('single');
|
||||
|
||||
@@ -109,6 +159,7 @@ function init_departure_DT (){
|
||||
"singleDatePicker":true,
|
||||
"timePicker":true,
|
||||
"timePicker24Hour":true,
|
||||
"locale": changeLangForDateTimePicker(),
|
||||
},
|
||||
function(start, end, label) {
|
||||
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
|
||||
@@ -143,6 +194,7 @@ $(function () {
|
||||
$(place_1).daterangepicker({
|
||||
"autoapply": true,
|
||||
"linkedCalendars": false,
|
||||
"locale": changeLangForDateTimePicker(),
|
||||
|
||||
},
|
||||
function (start, end, label) {
|
||||
@@ -175,6 +227,7 @@ $(function() {
|
||||
$(place_1).daterangepicker({
|
||||
"autoapply": true,
|
||||
"linkedCalendars": false,
|
||||
"locale": changeLangForDateTimePicker(),
|
||||
onl_param
|
||||
},
|
||||
function(start, end, label) {
|
||||
|
||||
Reference in New Issue
Block a user