Skip to content

Сулейманов Эмиль#7

Open
theSweater23 wants to merge 2 commits intoRTF-Angular-2021:masterfrom
theSweater23:suleymanov_emil
Open

Сулейманов Эмиль#7
theSweater23 wants to merge 2 commits intoRTF-Angular-2021:masterfrom
theSweater23:suleymanov_emil

Conversation

@theSweater23
Copy link

No description provided.

if(time.hours > this.hours)
return true;
else
{
Copy link

Choose a reason for hiding this comment

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

С такой проверкой время 8:40 будет не раньше чем 10:50, а это логическая ошибка

Time.prototype.isLater = function(time){
if(time.hours < this.hours)
return true;
else
Copy link

Choose a reason for hiding this comment

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

Тут кажется та же логическая ошибка, что и в isEarlier

};

Meeting.prototype.isMeetingInTimeRange = function(start, end){
if (this.startTime.hours == start.hours)
Copy link

Choose a reason for hiding this comment

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

Сравнивать надо вместе с типами!

Meeting.prototype.isMeetingInTimeRange = function(start, end){
if (this.startTime.hours == start.hours)
{
if (this.endTime.hours < end.hours) return true;
Copy link

Choose a reason for hiding this comment

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

Любые блоки даже те, которые состоят из 1 строки, лучше выделять фигурными скобками и писать с новой строки. Так легче читать чужой код

this.meetings = meetings;
this.vacations = vacations;
};

Copy link

Choose a reason for hiding this comment

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

Зачтено на 3 балла

function Vacation(vacationStartDate, vacationEndDate) { };
function Vacation(vacationStartDate, vacationEndDate) {
if (vacationStartDate > vacationEndDate ||
(vacationStartDate.getDate() == vacationEndDate.getDate())) throw new Error();
Copy link

Choose a reason for hiding this comment

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

Сравнивать надо вместе с типами!


Vacation.prototype.isDateInVacation = function(date){
if (this.vacationStartDate.getDate() <= date.getDate() && this.vacationEndDate.getDate() >= date.getDate() &&
date.getFullYear() == this.vacationStartDate.getFullYear())
Copy link

Choose a reason for hiding this comment

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

Сравнивать надо вместе с типами!

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.

2 participants