Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick fix #19

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ export const POINT_EMPTY = {
offers: [],
type: DEFAULT_TYPE,
};

const MSEC_IN_SEC = 1000;
const SEC_IN_MIN = 60;
const MIN_IN_HOUR = 60;
const HOUR_IN_DAY = 24;
export const MSEC_IN_HOUR = MIN_IN_HOUR * SEC_IN_MIN;
export const MSEC_IN_HOUR = MIN_IN_HOUR * SEC_IN_MIN * MSEC_IN_SEC;
export const MSEC_IN_DAY = HOUR_IN_DAY * MSEC_IN_HOUR;
5 changes: 1 addition & 4 deletions src/presenter/point-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default class PointPresenter {

setAborting = () => {
if(this.#mode === Mode.DEFAULT){
this.#editPointElement.shake();
this.#pointElement.shake();
}
else {
this.#editPointElement.shake(this.#resetFormState);
Expand Down Expand Up @@ -167,9 +167,6 @@ export default class PointPresenter {
isMinor ? UpdateType.MINOR : UpdateType.PATCH,
point
);
if (!this.#editPointElement._state.isDisabled) {
this.#replaceToPoint();
}
};

#onEditPointDelete = (point) =>{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const isMinorUpdate = (pointA, pointB) =>

export const getDateDiff = (pointA, pointB) => dayjs(pointA.dateFrom).diff(dayjs(pointB.dateFrom));

export const getPriceDiff = (pointA, pointB) => pointA.basePrice - pointB.basePrice;
export const getPriceDiff = (pointA, pointB) => pointB.basePrice - pointA.basePrice;

export const getDurationDiff = (pointA, pointB) =>
dayjs(pointB.dateTo).diff(dayjs(pointB.dateFrom)) - dayjs(pointA.dateTo).diff(dayjs(pointA.dateFrom));
Expand Down
Loading