-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix(universal-date-input): fix date validation #1545
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 11df06b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Собрана новая демка. |
end: max, | ||
}); | ||
const date = clamp( | ||
new Date(`${segments.year}-${segments.month}-${segments.day}T00:00:00`), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут просто сбросил время на 00:00:00?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил временную метку, так как без нее new Date
в JS автоматически преобразует её в локальное время пользователя, основываясь на его часовом поясе (это ощутимо при смене часовых поясов с очень большой разницей, например добавляем utc 06.01, а в Гонолулу будет 05.01, что приводит к ошибке которую зарепортили).
При добавлении T00:00:00, мы указаываем время в дополнение к дате. JS интерпретирует такую строку как дату и время локальной временной зоны
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправление валидации вводимого времени
https://jira.moscow.alfaintra.net/browse/DS-8066