Skip to content

Каширин Максим#30

Open
Vole1 wants to merge 7 commits into
urfu-2016:masterfrom
Vole1:master
Open

Каширин Максим#30
Vole1 wants to merge 7 commits into
urfu-2016:masterfrom
Vole1:master

Conversation

@Vole1
Copy link
Copy Markdown

@Vole1 Vole1 commented May 3, 2017

No description provided.

Copy link
Copy Markdown

@mokhov mokhov left a comment

Choose a reason for hiding this comment

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

Хорошо, но может быть лучше и аккуратнее

Comment thread formatDate.js Outdated
// Напишите код форматирования даты в этом месте
const moths = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря']

function formatDate(date1) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Странное название аргумента «date1»

Comment thread formatDate.js Outdated
else
var hours = date.getUTCHours();
if (date.getUTCMinutes() < 10)
var minutes = '0' + date.getUTCMinutes();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно вынести добавление 0 в хэлпер

Comment thread formatDate.js Outdated
return 'вчера в '+ hours + ':' + minutes;
}
if (date.getFullYear() < curYear)
return date.getUTCDate() + ' ' + moths[date.getUTCMonth()] + ' ' + date.getFullYear() + ' года в ' + hours + ':'+ minutes;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Вызовы .getUTC* можно закэшировать в переменную

Comment thread tests/formatDate-test.js



it ('should throw error when arguments number is 0', () =>{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нет проверки что аргументов не может быть больше 1

Comment thread tests/formatDate-test.js Outdated
assert.equal(actual, "31 января 2000 года в 11:59");
});

it('should return `31 декабря 1999 года в 23:59` for `1999-12-31T10:59:59.999Z`', () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Зачем этот тест?

Copy link
Copy Markdown

@mokhov mokhov left a comment

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