-
Notifications
You must be signed in to change notification settings - Fork 27
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
Крылосова Валерия #28
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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', |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
кажется нужное закомментировано)
} | ||
catch(err){ | ||
throw err; | ||
}} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); вернет текущее время, а это некорректное поведение
No description provided.