-
Notifications
You must be signed in to change notification settings - Fork 98
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
Игнатенко Алексей #74
base: master
Are you sure you want to change the base?
Conversation
🍅 Не пройден линтинг или базовые тесты |
🍅 Пройдено тестов 9 из 16 |
🍅 Пройдено тестов 9 из 16 |
🍅 Пройдено тестов 9 из 16 |
🍅 Пройдено тестов 9 из 16 |
🍅 Не пройден линтинг или базовые тесты |
🍅 Пройдено тестов 11 из 16 |
🍏 Пройдено тестов 16 из 16 |
🍅 Не пройден линтинг или базовые тесты |
🍏 Пройдено тестов 16 из 16 |
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 isStar = true; | ||
const isStar = false; | ||
|
||
const minutesPerHour = 60; |
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 MINUTES_PER_HOUR = 60;
|
||
let dayTimeStrToMinutes = (weekDay, timeStr, timeZone, bankTimeZone) => | ||
[weekDays.indexOf(weekDay) * minutesPerHour * hourPerDay, | ||
timeStr.split(':')[0] * minutesPerHour + Number(timeStr.split(':')[1]), |
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.
timeStr.split(':') можно в переменную, чтобы 2 раза не сплитить
[weekDays.indexOf(weekDay) * minutesPerHour * hourPerDay, | ||
timeStr.split(':')[0] * minutesPerHour + Number(timeStr.split(':')[1]), | ||
(bankTimeZone - (timeZone === undefined ? 0 : Number(timeZone))) * minutesPerHour | ||
].reduce((a, b) => a + b); |
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.
какой тут смысл от reduce, когда можно просто сложить переменные?
let addTimeToTwoChars = (time) => time.toString().length === 2 ? time.toString() : `0${time}`; | ||
|
||
function minutesToDayTime(minutes, bankTimeZone) { | ||
let weekDay = parseInt(minutes / (minutesPerHour * hourPerDay)); |
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.
parseInt(minutes / (minutesPerHour * hourPerDay), 10);
let bankTimeZone = Number(workingHours.from.split('+')[1]); | ||
bankTimeZone = isNaN(bankTimeZone) ? 0 : bankTimeZone; | ||
workingHours = getBankSchedule(workingHours, bankTimeZone); | ||
let answer = [NaN].concat(Object.keys(schedule) |
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.
такой код очень сложно читать и понимать
что тут вообще происходит? напиши комментарии, на какой строчке что делается
Например, зачем [NaN] в начале?
Где заканчивается вызов [NaN].concat(... ?
No description provided.