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, }