Skip to content

Commit

Permalink
Добавила минуту для минимального времени окончания ивента.
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaWithSalt committed Jun 19, 2024
1 parent 2c4da1d commit 007cd58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/const.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -55,6 +56,7 @@ const FILTER_TYPE_MESSAGE = {

export {
API_SRC,
ONE_MINUTE,
AUTHORIZATION,
MAX_EVENTS_LENGTH,
ACTIONS,
Expand Down
4 changes: 2 additions & 2 deletions src/view/editing-form-view.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit 007cd58

Please sign in to comment.