Skip to content

Conversation

@PAVLUXAN
Copy link
Contributor

@PAVLUXAN PAVLUXAN commented Jun 17, 2025

@keksobot keksobot changed the title feat:create new function Функции возвращаются Jun 17, 2025
keksobot pushed a commit that referenced this pull request Jun 17, 2025
@keksobot
Copy link
Contributor

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

js/functions.js Outdated
};
const getTimeConv = (time) => {
const timelist = time.split(':');
const finalResult = Number(timelist[0]) * 60 + Number(timelist[1]);

Choose a reason for hiding this comment

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

"финальный результат" - это очень абстрактно. Эта функция возвращает что очень конкретное, но название функции и результата скрывают это.

Что вернет функция?

js/functions.js Outdated
const isWorkTime = (startDate, endDate, startMeet, durationMeet) =>{
const duration = durationMeet + getTimeConv(startMeet);
if(getTimeConv(startDate) <= duration && duration <= getTimeConv(endDate)){
return true;

Choose a reason for hiding this comment

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

если требуется вернуть логическое значение и для этого есть логическое выражение - возвращаем его результат

return getTimeConv(startDate) <= duration && duration <= getTimeConv(endDate);

js/functions.js Outdated
//console.log(getTimeConv('00:01'));

const isWorkTime = (startDate, endDate, startMeet, durationMeet) =>{
const duration = durationMeet + getTimeConv(startMeet);

Choose a reason for hiding this comment

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

скорее всего, это не "продолжительность". Начало встречи + продолжительность = окончание встречи (в минутах, так как выполнена конвертация)

@keksobot keksobot merged commit 4c003dc into htmlacademy-javascript:master Jun 18, 2025
1 check failed
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