From 007cd5872160370e723df1952ae7055794a52736 Mon Sep 17 00:00:00 2001 From: June Date: Wed, 19 Jun 2024 15:06:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=BC=D0=B8=D0=BD=D1=83=D1=82=D1=83=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BC=D0=B8=D0=BD=D0=B8=D0=BC=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=20=D0=BE=D0=BA=D0=BE=D0=BD=D1=87=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B8=D0=B2=D0=B5=D0=BD=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/const.js | 2 ++ src/view/editing-form-view.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/const.js b/src/const.js index 8e6f2ba..924b42f 100644 --- a/src/const.js +++ b/src/const.js @@ -1,6 +1,7 @@ const API_SRC = 'https://23.objects.htmlacademy.pro/big-trip'; const AUTHORIZATION = 'Basic awdaf5g34123csdrh56w2r51'; +const ONE_MINUTE = 60000; const MAX_EVENTS_LENGTH = 3; const ACTIONS = { @@ -55,6 +56,7 @@ const FILTER_TYPE_MESSAGE = { export { API_SRC, + ONE_MINUTE, AUTHORIZATION, MAX_EVENTS_LENGTH, ACTIONS, diff --git a/src/view/editing-form-view.js b/src/view/editing-form-view.js index 121c5c6..d8ba304 100644 --- a/src/view/editing-form-view.js +++ b/src/view/editing-form-view.js @@ -1,5 +1,5 @@ import {humanizeWaypointDueDate} from '../utils.js'; -import {ACTIONS, DATE_FORMAT_EDIT} from '../const.js'; +import {ACTIONS, DATE_FORMAT_EDIT, ONE_MINUTE} from '../const.js'; import AbstractStatefulView from '../framework/view/abstract-stateful-view'; import 'flatpickr/dist/flatpickr.min.css'; import flatpickr from 'flatpickr'; @@ -224,7 +224,7 @@ export default class EditingFormView extends AbstractStatefulView { ['time_24hr']: true, dateFormat: 'd/m/y H:i', defaultDate: this._state.dateTo, - minDate: this.#datepickerFrom.selectedDates[0], + minDate: new Date(this.#datepickerFrom.selectedDates[0]?.getTime() + ONE_MINUTE), enableTime: true, onChange: this.#onCloseDateTo, }