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х задач по 2му занятию #2

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

YuGulin
Copy link

@YuGulin YuGulin commented Dec 20, 2024

Решение задач к Основы: Часть 1

  • [createApp]
  • [Шаблон: погода в Средиземье]

@jsru-1
Copy link
Contributor

jsru-1 commented Dec 20, 2024

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

@jsru-1 jsru-1 requested a review from ShGKme December 20, 2024 01:54
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 +4 to +6
function getIconByConditionId(id) {
return WeatherConditionIcons[parseInt(id)] || '';
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Vue сам приводит undefined к пустой строке при выводе

Comment on lines +8 to +14
function timeToSeconds(time) {
return time.split(':')[0]*60 + time.split(':')[1]*1;
}

function isDayNow(currientTime, sunriseTime, sunsetTime) {
return timeToSeconds(sunriseTime) < timeToSeconds(currientTime) && timeToSeconds(currientTime) < timeToSeconds(sunsetTime);
}
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'

@jsru-1 jsru-1 merged commit 9261b22 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.

3 participants