fix apply data of citydetails
This commit is contained in:
parent
19c915fdbf
commit
619c429d36
|
@ -109,14 +109,14 @@ function getCityDetails() {
|
|||
const selectedBank = bankSelect.options[bankSelect.selectedIndex].value; // Get selected bank
|
||||
const cityInput = document.getElementById("cityInput").value; // Get city input
|
||||
const datepickerInput = document.getElementById("datepicker").value; // Get date from datepicker
|
||||
saveCityDetails(selectedBank,cityInput,datepickerInput);
|
||||
saveCityDetails(selectedBank, cityInput, datepickerInput);
|
||||
// Concatenate the details into the cityDetails variable
|
||||
const cityDetails = `${selectedBank} ${cityInput} ${datepickerInput}`.trim(); // Trim to remove any extra spaces
|
||||
console.log(cityDetails); // For debugging
|
||||
return cityDetails; // Return the cityDetails string for further use
|
||||
}
|
||||
|
||||
function saveCityDetails(selectedBank,cityInput,datepickerInput) {
|
||||
function saveCityDetails(selectedBank, cityInput, datepickerInput) {
|
||||
var citydetails = {
|
||||
selectedBank,
|
||||
cityInput,
|
||||
|
@ -140,13 +140,37 @@ function loadCityDetails() {
|
|||
if (citydetails.cityInput) {
|
||||
// Change the city input value
|
||||
const cityInput = document.getElementById("cityInput");
|
||||
cityInput.value = сitydetails.cityInput; // Set city input
|
||||
$("#cityInput").val(citydetails.cityInput);
|
||||
// cityInput.value = сitydetails.cityInput; // Set city input
|
||||
}
|
||||
|
||||
if (citydetails.datepickerInput) {
|
||||
// Change the datepicker input value
|
||||
const datepickerInput = document.getElementById("datepicker");
|
||||
datepickerInput.value = citydetails.datepickerInput; // Set datepicker input
|
||||
console.log(citydetails.datepickerInput);
|
||||
|
||||
$(function () {
|
||||
$('#datepicker').datepicker({
|
||||
closeText: "Закрыть",
|
||||
prevText: "Пред",
|
||||
nextText: "След",
|
||||
currentText: "Сегодня",
|
||||
monthNames: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь",
|
||||
"Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"],
|
||||
monthNamesShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн",
|
||||
"Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],
|
||||
dayNames: ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"],
|
||||
dayNamesShort: ["вск", "пнд", "втр", "срд", "чтв", "птн", "сбт"],
|
||||
dayNamesMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"],
|
||||
weekHeader: "Нед",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ""
|
||||
});
|
||||
|
||||
$('#datepicker').datepicker('setDate', citydetails.datepickerInput);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue