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

Игнатенко Алексей #74

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Alexxxir
Copy link

No description provided.

@honest-hrundel honest-hrundel changed the title test Игнатенко Алексей Oct 30, 2018
@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍅 Пройдено тестов 9 из 16

@honest-hrundel
Copy link

🍅 Пройдено тестов 9 из 16

@honest-hrundel
Copy link

🍅 Пройдено тестов 9 из 16

@honest-hrundel
Copy link

🍅 Пройдено тестов 9 из 16

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍅 Пройдено тестов 11 из 16

@honest-hrundel
Copy link

🍏 Пройдено тестов 16 из 16

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍏 Пройдено тестов 16 из 16

Copy link

@nex2hex nex2hex left a 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;
Copy link

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]),
Copy link

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);
Copy link

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));
Copy link

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)
Copy link

Choose a reason for hiding this comment

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

такой код очень сложно читать и понимать
что тут вообще происходит? напиши комментарии, на какой строчке что делается

Например, зачем [NaN] в начале?
Где заканчивается вызов [NaN].concat(... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants