Merge remote-tracking branch 'origin/main'

This commit is contained in:
2023-09-24 14:57:29 +03:00
11 changed files with 122 additions and 93 deletions

View File

@@ -16,6 +16,10 @@
}
.font-base{
font-size: 16px;
}
.mb-10{
margin-bottom: 10px;
}

View File

@@ -147,9 +147,9 @@
this.timePicker && (this.renderTimePicker("left"), this.renderTimePicker("right"), this.endDate ? this.container.find(".right .calendar-time select").prop("disabled", !1).removeClass("disabled") : this.container.find(".right .calendar-time select").prop("disabled", !0).addClass("disabled")), this.endDate && this.container.find(".drp-selected").html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)), this.updateMonthsInView(), this.updateCalendars(), this.updateFormInputs()
}, updateMonthsInView: function () {
if (this.endDate) {
if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && (this.startDate.format("YYYY-MM") == this.leftCalendar.month.format("YYYY-MM") || this.startDate.format("YYYY-MM") == this.rightCalendar.month.format("YYYY-MM")) && (this.endDate.format("YYYY-MM") == this.leftCalendar.month.format("YYYY-MM") || this.endDate.format("YYYY-MM") == this.rightCalendar.month.format("YYYY-MM"))) return;
if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && (this.startDate.format("MM.YYYY") == this.leftCalendar.month.format("MM.YYYY") || this.startDate.format("MM.YYYY") == this.rightCalendar.month.format("MM.YYYY")) && (this.endDate.format("MM.YYYY") == this.leftCalendar.month.format("MM.YYYY") || this.endDate.format("MM.YYYY") == this.rightCalendar.month.format("MM.YYYY"))) return;
this.leftCalendar.month = this.startDate.clone().date(2), this.linkedCalendars || this.endDate.month() == this.startDate.month() && this.endDate.year() == this.startDate.year() ? this.rightCalendar.month = this.startDate.clone().date(2).add(1, "month") : this.rightCalendar.month = this.endDate.clone().date(2)
} else this.leftCalendar.month.format("YYYY-MM") != this.startDate.format("YYYY-MM") && this.rightCalendar.month.format("YYYY-MM") != this.startDate.format("YYYY-MM") && (this.leftCalendar.month = this.startDate.clone().date(2), this.rightCalendar.month = this.startDate.clone().date(2).add(1, "month"));
} else this.leftCalendar.month.format("MM.YYYY") != this.startDate.format("MM.YYYY") && this.rightCalendar.month.format("MM.YYYY") != this.startDate.format("MM.YYYY") && (this.leftCalendar.month = this.startDate.clone().date(2), this.rightCalendar.month = this.startDate.clone().date(2).add(1, "month"));
this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate && (this.rightCalendar.month = this.maxDate.clone().date(2), this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, "month"))
}, updateCalendars: function () {
if (this.timePicker) {
@@ -357,12 +357,12 @@
var t = !0, e = 0;
for (var a in this.ranges) {
if (this.timePicker) {
var i = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm";
var i = this.timePickerSeconds ? "DD.MM.YYYY:mm:ss" : "DD.MM.YYYY HH:mm";
if (this.startDate.format(i) == this.ranges[a][0].format(i) && this.endDate.format(i) == this.ranges[a][1].format(i)) {
t = !1, this.chosenLabel = this.container.find(".ranges li:eq(" + e + ")").addClass("active").attr("data-range-key");
break
}
} else if (this.startDate.format("YYYY-MM-DD") == this.ranges[a][0].format("YYYY-MM-DD") && this.endDate.format("YYYY-MM-DD") == this.ranges[a][1].format("YYYY-MM-DD")) {
} else if (this.startDate.format("DD.MM.YYYY") == this.ranges[a][0].format("DD.MM.YYYY") && this.endDate.format("DD.MM.YYYY") == this.ranges[a][1].format("DD.MM.YYYY")) {
t = !1, this.chosenLabel = this.container.find(".ranges li:eq(" + e + ")").addClass("active").attr("data-range-key");
break
}
@@ -389,7 +389,7 @@
}
if (i) {
var h = this.startDate.clone();
h.hour(s), h.minute(n), h.second(r), this.setStartDate(h), this.singleDatePicker ? this.endDate = this.startDate.clone() : this.endDate && this.endDate.format("DD-MM-YYYY") == h.format("DD-MM-YYYY") && this.endDate.isBefore(h) && this.setEndDate(h.clone())
h.hour(s), h.minute(n), h.second(r), this.setStartDate(h), this.singleDatePicker ? this.endDate = this.startDate.clone() : this.endDate && this.endDate.format("DD.MM.YYYY") == h.format("DD.MM.YYYY") && this.endDate.isBefore(h) && this.setEndDate(h.clone())
} else if (this.endDate) {
var l = this.endDate.clone();
l.hour(s), l.minute(n), l.second(r), this.setEndDate(l)
@@ -410,7 +410,9 @@
}, remove: function () {
this.container.remove(), this.element.off(".daterangepicker"), this.element.removeData()
}
}, e.fn.daterangepicker = function (t, i) {
},
e.fn.daterangepicker = function (t, i) {
var s = e.extend(!0, {}, e.fn.daterangepicker.defaultOptions, t);
return this.each(function () {
var t = e(this);

4
static/js/jquery_3_2_1.js vendored Normal file

File diff suppressed because one or more lines are too long

7
static/js/moment_js.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -43,23 +43,23 @@
// });
// }
// });
function init_arrival_DT (){
$(function () {
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker: true"
onl_param = "singleDatePicker"
}
let place_1 = document.querySelector("#id_arrival_DT")
if (place_1) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
"singleDatePicker":true
},
function (start, end, label) {
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
$('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'))
$('#id_arrival_DT').val(start.format('DD.MM.YYYY'))
});
$(`${place_1.id} .drp-calendar.right`).hide();
@@ -74,7 +74,76 @@ $(function () {
el.append('<span></span>');
});
}
});
}
function init_departure_DT (){
let place_1 = document.querySelector("#id_departure_DT")
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker"
}
if (place_1) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
"singleDatePicker":true
},
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');
$('#id_departure_DT').val(start.format('DD.MM.YYYY'))
});
$(`${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')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
}
}
$(function () {
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker: true"
}
let place_1 = document.querySelector("#id_arrival_DT")
if (place_1) {
$(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'));
$('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'))
});
$(`${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')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
}
});
$(function() {
let place_1 = document.querySelector("#id_departure_DT")

View File

@@ -571,76 +571,17 @@ function OnSelectionChange(el) {
// if(checkbox_width.childElementCount === 4){
// checkbox_width.classList.add('width')
// }
sliderInit();
$(function () {
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker: true"
}
let place_1 = document.querySelector("#id_arrival_DT")
if (place_1) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
sliderInit();
},
function (start, end, label) {
init_arrival_DT()
init_departure_DT()
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
$('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'))
});
$(`${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')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
}
});
$(function() {
let place_1 = document.querySelector("#id_departure_DT")
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker: true"
}
if (place_1) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
onl_param
},
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');
$('#id_departure_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'))
});
$(`${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')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
}
});
}
});
};
}

View File

@@ -60,19 +60,19 @@
<label for="id_departure_DT">{{ form.fields.departure_DT.label }}</label>
<input
type="datetime-local"
min= {% now "Y-m-d" %}T{% now "H:i" %}
name="departure_DT"
onchange="checkDate()"
{% if form.fields.departure_DT.required %} required{% endif %}
id="id_departure_DT"
class="el_form_b_new_route"
placeholder="Выберите дату и время"
{% if form.initial.departure_DT %}value="{{ form.initial.departure_DT.date|date:"Y-m-d" }}T{{ form.initial.departure_DT.time|date:"H:i" }}"{% endif %}
/>
{# <input#}
{# type="datetime-local"#}
{# min= {% now "Y-m-d" %}T{% now "H:i" %}#}
{# name="departure_DT"#}
{# onchange="checkDate()"#}
{# {% if form.fields.departure_DT.required %} required{% endif %}#}
{# id="id_departure_DT"#}
{# class="el_form_b_new_route"#}
{# placeholder="Выберите дату и время"#}
{# {% if form.initial.departure_DT %}value="{{ form.initial.departure_DT.date|date:"Y-m-d" }}T{{ form.initial.departure_DT.time|date:"H:i" }}"{% endif %}#}
{# />#}
{# boris change input #}
<input class="el_form_find_route" type="text" id="id_departure_DT" name="departure_DT" placeholder="" {% if route_form.initial.departure_DT %} value="{{ route_form.initial.departure_DT }}"{% endif %}/>
<input class="el_form_b_new_route" type="text" id="id_departure_DT" name="departure_DT" placeholder="" {% if route_form.initial.departure_DT %} value="{{ route_form.initial.departure_DT }}"{% endif %}/>
<div id="displayRegervation"></div>
{# end #}
@@ -94,7 +94,7 @@
{# {% if form.initial.arrival_DT %}value="{{ form.initial.arrival_DT.date|date:"Y-m-d" }}T{{ form.initial.arrival_DT.time|date:"H:i" }}"{% endif %}#}
{# />#}
{# boris change input #}
<input class="el_form_find_route" type="text" id="id_arrival_DT" name="arrival_DT" placeholder="" {% if route_form.initial.departure_DT %} value="{{ route_form.initial.departure_DT }}"{% endif %}/>
<input class="el_form_b_new_route" type="text" id="id_arrival_DT" name="arrival_DT" placeholder="" {% if route_form.initial.departure_DT %} value="{{ route_form.initial.departure_DT }}"{% endif %}/>
<div id="displayRegervation"></div>
{# end #}
{% if not errors_off and form.errors and form.errors.arrival_DT %}

View File

@@ -13,6 +13,7 @@
{% include "connect_ws_js.html" %}
<script src="{% static "js/filters_functions_find_route.js" %}"></script>
<script src="{% static "js/dynamic_loading_routes.js" %}"></script>
{# <script src="{% static "js/range_calendar.js" %}"></script>#}
{% endblock %}

View File

@@ -3,7 +3,7 @@
{% block meta %}
<script src='{% static "js/jquery_v3_6_4.js" %}'> </script>
{# <script src='{% static "js/jquery_v3_6_4.js" %}'> </script>#}
<script src='{% static "js/ion.rangeSlider.min.js" %}'> </script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" rel="stylesheet">
<script src='{% static "js/user_profile.js" %}'> </script>

View File

@@ -8,12 +8,12 @@
<title>Title</title>
<script src='{% static "js/jquery_v3_6_4.js" %}'> </script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
{# <script src='{% static "js/jquery_v3_6_4.js" %}'> </script>#}
<script type="text/javascript" src="{% static "js/jquery_3_2_1.js" %}"></script>
<script type="text/javascript" src="{% static "js/moment_js.js" %}"></script>
<script type="text/javascript" src="{% static "js/datarangepicker.js" %}"></script>
<script src="{% static "js/rangecalendartech.js" %}"></script>
<script src="{% static "js/range_calendar.js" %}"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
@@ -45,7 +45,8 @@
{# <script src="{% static "js/range_calendar.js" %}"></script>#}
<script src="{% static "js/range_calendar.js" %}"></script>
{% block meta %}
{% endblock %}