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

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

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

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

wants to merge 7 commits into from

Conversation

Vole1
Copy link

@Vole1 Vole1 commented May 3, 2017

No description provided.

Copy link

@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.

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

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

function formatDate(date1) {
Copy link

Choose a reason for hiding this comment

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

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

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

Choose a reason for hiding this comment

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

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

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

Choose a reason for hiding this comment

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

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




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

Choose a reason for hiding this comment

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

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

assert.equal(actual, "31 января 2000 года в 11:59");
});

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

Choose a reason for hiding this comment

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

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

Copy link

@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