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

вывод даты #2

Merged
merged 3 commits into from
Dec 20, 2024
Merged

вывод даты #2

merged 3 commits into from
Dec 20, 2024

Conversation

luquii2
Copy link

@luquii2 luquii2 commented Dec 20, 2024

No description provided.

@jsru-1
Copy link
Contributor

jsru-1 commented Dec 20, 2024

Добавляю преподавателя (@ShGKme) для код-ревью.

@jsru-1 jsru-1 requested a review from ShGKme December 20, 2024 09:54
@jsru-1
Copy link
Contributor

jsru-1 commented Dec 20, 2024

Решение было обновлено, посмотрим что скажет @ShGKme

Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Принято, есть пара комментариев

Comment on lines +18 to +23
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
}
Copy link
Contributor

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' })
Copy link
Contributor

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. Так локализация всегда будет той, что пользователь выбрал в настройках своего браузера.

@jsru-1 jsru-1 merged commit 8b6d547 into js-tasks-ru:master Dec 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants