Skip to content

Commit

Permalink
✔️ Сборка #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Keks committed Jan 19, 2025
1 parent ce2c6a6 commit 25840d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 6/js/functions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const MINUTES_IN_HOUR = 60;

const checkLength = (string, length) => string.length <= length;

checkLength('проверяемая строка', 18);
Expand Down Expand Up @@ -41,7 +43,7 @@ getNumber('ECMAScript 2022');

function parseTime(time){
const [hours, minutes] = time.split(':').map(Number);
return hours * 60 + minutes;
return hours * MINUTES_IN_HOUR + minutes;
}

const isMeeting = (startWork, endWork, startMeeting, duration) => {
Expand All @@ -51,9 +53,7 @@ const isMeeting = (startWork, endWork, startMeeting, duration) => {

const meetingEnd = meetingStart + duration;

const isTimeOfMeeting = meetingStart >= workStart && meetingEnd <= workEnd;

return isTimeOfMeeting;
return meetingStart >= workStart && meetingEnd <= workEnd;
};

isMeeting('14:00', '17:30', '08:0', 90);

0 comments on commit 25840d7

Please sign in to comment.