-
Notifications
You must be signed in to change notification settings - Fork 1
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
вывод даты #2
вывод даты #2
Conversation
Добавляю преподавателя (@ShGKme) для код-ревью. |
Решение было обновлено, посмотрим что скажет @ShGKme |
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.
Принято, есть пара комментариев
const isNight = function({dt,sunrise,sunset} = data){ | ||
const currentTime = Number(dt.slice(0,2)) | ||
const currntSunrise = Number(sunrise.slice(0,2)) | ||
const currntSunset = Number(sunset.slice(0,2)) | ||
return currentTime < currntSunrise && currentTime < currntSunset | ||
} |
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.
Строки в формате HH:MM
можно сравнивать просто лексикографически как строки без преобразований. '08:30' < '09:12'
const App = defineComponent({ | ||
name: 'app', | ||
setup() { | ||
const date = new Date().toLocaleDateString('en-EN', { dateStyle: 'long' }) |
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.
Вместо фиксированной локализации (en-US
или ru-RU
) лучше всегда использовать navigator.language
. Так локализация всегда будет той, что пользователь выбрал в настройках своего браузера.
No description provided.