Skip to content

Comments

Крылосова Валерия#28

Open
Ngbtl95 wants to merge 2 commits intourfu-2016:masterfrom
Ngbtl95:master
Open

Крылосова Валерия#28
Ngbtl95 wants to merge 2 commits intourfu-2016:masterfrom
Ngbtl95:master

Conversation

@Ngbtl95
Copy link

@Ngbtl95 Ngbtl95 commented May 3, 2017

No description provided.

Copy link
Collaborator

@zmenka zmenka left a comment

Choose a reason for hiding this comment

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

Не хватает тестов на функцию получения твитов и небольшие доработки по коду

}
var now = new Date();
var date = new Date(date);
var dateTime = date.toLocaleTimeString('ru-RU',
Copy link
Collaborator

Choose a reason for hiding this comment

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

new Date('2017-04-25T22:09:10.609Z').toLocaleTimeString('ru-RU',{ hour: '2-digit', minute: '2-digit', hour12: false}) вывело "3:09", так что ноль в начале не подставляется

body.forEach(function(item, i, body) {
//date = formatDate(item['created_at'])
//console.log(date + '\n' + item['text'] + '\n' + ' ');
console.log('1')
Copy link
Collaborator

Choose a reason for hiding this comment

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

кажется нужное закомментировано)

}
catch(err){
throw err;
}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Можно убрать try catch, var date = () => formatDate('23 марта') точно также сработает

console.log(error)
}
else{
body = JSON.parse(body)
Copy link
Collaborator

Choose a reason for hiding this comment

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

здесь можно добавить try catch, тогда сможем отличить ошибку при получении запроса от ошибки некорректного json-a, и можно будет это протестить

// Напишите код форматирования даты в этом месте
}
var now = new Date();
var date = new Date(date);
Copy link
Collaborator

Choose a reason for hiding this comment

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

А если от api не придет дата? Тогда var date = new Date(date); вернет текущее время, а это некорректное поведение

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