This commit is contained in:
2023-09-23 14:54:12 +03:00
parent 573b8ec0c3
commit 84620e74f8
4 changed files with 44 additions and 24 deletions

View File

@@ -843,13 +843,13 @@
/*}*/ /*}*/
.from_address_point_txt.find_route.first{ .from_address_point_txt.find_route.first{
border-top: 1px solid #E6E6E6; border-top: 1px solid #E6E6E6;
border-right: 0; border-right: 0;
border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid #E6E6E6;
border-left: 1px solid #E6E6E6; border-left: 1px solid #E6E6E6;
display: block; display: block;
height: 20px; height: 20px;
width: 58.1%; width: 55.1%;
float: left; float: left;
background-image: none !important; background-image: none !important;
margin-top: 0; margin-top: 0;
@@ -864,7 +864,7 @@
border-left: 1px solid #E6E6E6; border-left: 1px solid #E6E6E6;
display: block; display: block;
height: 20px; height: 20px;
width: 58.1%; width: 55.1%;
border-radius: 0; border-radius: 0;
float: left; float: left;
background-image: none !important; background-image: none !important;
@@ -956,7 +956,7 @@
display: inline-block; display: inline-block;
float: right; float: right;
width: 29%; width: 29%;
height: 97%; height: 95%;
border-top: 1px solid #E6E6E6; border-top: 1px solid #E6E6E6;
border-right: 1px solid #E6E6E6; border-right: 1px solid #E6E6E6;
border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid #E6E6E6;

View File

@@ -111,12 +111,6 @@ function forloop_func_form (data,get,str) {
} }
}else if (name_el === "regervation"){
let departure_DT = list_of_elements_form[i].dataset['departure_DT']
let arrival_DT = list_of_elements_form[i].dataset['arrival_DT']
data['departure_DT'] = departure_DT
data['arrival_DT'] = arrival_DT
str = `${str}departure_DT=${departure_DT}&arrival_DT=${arrival_DT}&`
} else { } else {
let name_el = name_attr.value let name_el = name_attr.value
data[name_el] = value_el data[name_el] = value_el

View File

@@ -45,21 +45,47 @@
// }); // });
$(function() { $(function() {
$('#regervation').daterangepicker({ let place_1 = document.querySelector("#id_arrival_DT")
$(place_1).daterangepicker({
"autoapply": true, "autoapply": true,
"linkedCalendars": false, "linkedCalendars": false,
}, },
function(start, end, label) { function(start, end, label) {
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); // $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
$('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD'); // $('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD');
$('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD'); // $('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD');
}); });
$('.drp-calendar.right').hide(); $(`${place_1.id} .drp-calendar.right`).hide();
$('.drp-calendar.left').addClass('single'); $(`${place_1.id} .drp-calendar.left`).addClass('single');
$('.calendar-table').on('DOMSubtreeModified', function() { $(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() {
var el = $(".prev.available").parent().children().last(); var el = $(`${place_1.id} .prev.available`).parent().children().last();
if (el.hasClass('next available')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
});
$(function() {
let place_1 = document.querySelector("#id_departure_DT")
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
},
function(start, end, label) {
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
// $('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD');
// $('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD');
});
$(`${place_1.id} .drp-calendar.right`).hide();
$(`${place_1.id} .drp-calendar.left`).addClass('single');
$(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() {
var el = $(`${place_1.id} .prev.available`).parent().children().last();
if (el.hasClass('next available')) { if (el.hasClass('next available')) {
return; return;
} }

View File

@@ -76,17 +76,17 @@
</div> </div>
</div> </div>
<div class="cont-el-form-search-carrier"> <div class="cont-el-form-search-carrier">
<label for="id_departure_DT">Дата отправки - Дата прибытия</label> <label for="id_departure_DT">Дата отправки</label>
{# <input class="el_form_find_route" name="departure_DT" id="id_departure_DT" type="date" {% if route_form.fields.departure_DT.required %} {% endif %} {% if route_form.initial.departure_DT %} value="{{ route_form.initial.departure_DT }}"{% endif %} >#} {# <input class="el_form_find_route" name="departure_DT" id="id_departure_DT" type="date" {% if route_form.fields.departure_DT.required %} {% endif %} {% if route_form.initial.departure_DT %} value="{{ route_form.initial.departure_DT }}"{% endif %} >#}
<input class="el_form_find_route" type="text" name="regervation" id="regervation" placeholder="Please select regervation date!"/> <input class="el_form_find_route" type="text" id="id_departure_DT" name="departure_DT" placeholder="Please select regervation date!"/>
<div id="displayRegervation"></div> <div id="displayRegervation"></div>
</div> </div>
{# <div class="cont-el-form-search-carrier">#} <div class="cont-el-form-search-carrier">
{# <label for="id_arrival_DT">Дата прибытия</label>#} <label for="id_arrival_DT">Дата прибытия</label>
{# <input class="el_form_find_route" name="arrival_DT" id="id_arrival_DT" type="date" {% if route_form.initial.arrival_DT %} value="{{ route_form.initial.arrival_DT }}"{% endif %}>#} {# <input class="el_form_find_route" name="arrival_DT" id="id_arrival_DT" type="date" {% if route_form.initial.arrival_DT %} value="{{ route_form.initial.arrival_DT }}"{% endif %}>#}
{# <input type="text" name="regervation" id="regervation" placeholder="Please select regervation date!"/>#} <input type="text" name="regervation" id="id_arrival_DT" placeholder="Please select regervation date!"/>
{# <div id="displayRegervation"></div>#} <div id="displayRegervation"></div>
{# </div>#} </div>
<div class="cont-el-form-search-carrier last"> <div class="cont-el-form-search-carrier last">
<label>test</label> <label>test</label>
<select class="el_form_find_route" name="cargo_type" id="id_cargo_type" {% if route_form.fields.cargo_type.required %} {% endif %}> <select class="el_form_find_route" name="cargo_type" id="id_cargo_type" {% if route_form.fields.cargo_type.required %} {% endif %}>