3.4 KiB
3.4 KiB
title | id | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
Date manipulation | 5966c21cf732a95f1b67dd28 | 5 | Обработка даты |
Description
Учитывая строку даты в EST, выведите указанную дату в виде строки с добавлением 12 часов к времени.
Часовой пояс должен быть сохранен.
Пример ввода:
"March 7 2009 7:30pm EST"
Пример вывода:
"March 8 2009 7:30am EST"
Instructions
Tests
tests:
- text: <code>add12Hours</code> - это функция.
testString: 'assert(typeof add12Hours === "function", "<code>add12Hours</code> is a function.");'
- text: <code>add12Hours(dateString)</code> должен возвращать строку.
testString: 'assert(typeof add12Hours(tests[0]) === "string", "<code>add12Hours(dateString)</code> should return a string.");'
- text: '<code>add12Hours("" + tests[0] + "")</code> должны возвращать <code>"" + answers[0] + ""</code>'
testString: 'assert(add12Hours(tests[0]) === answers[0], "<code>add12Hours("" + tests[0] + "")</code> should return <code>"" + answers[0] + ""</code>");'
- text: 'Должен ли день обмена менять. <code>add12Hours("" + tests[1] + "")</code> должны возвращать <code>"" + answers[1] + ""</code>'
testString: 'assert(add12Hours(tests[1]) === answers[1], "Should handel day change. <code>add12Hours("" + tests[1] + "")</code> should return <code>"" + answers[1] + ""</code>");'
- text: 'Должен ли перенос месяца в високосный год. <code>add12Hours("" + tests[2] + "")</code> должны возвращать <code>"" + answers[2] + ""</code>'
testString: 'assert(add12Hours(tests[2]) === answers[2], "Should handel month change in a leap years. <code>add12Hours("" + tests[2] + "")</code> should return <code>"" + answers[2] + ""</code>");'
- text: 'Должен ли перенос месяца в течение общих лет. <code>add12Hours("" + tests[3] + "")</code> должны возвращать <code>"" + answers[3] + ""</code>'
testString: 'assert(add12Hours(tests[3]) === answers[3], "Should handel month change in a common years. <code>add12Hours("" + tests[3] + "")</code> should return <code>"" + answers[3] + ""</code>");'
- text: 'Должен измениться год выпуска. <code>add12Hours("" + tests[4] + "")</code> должны возвращать <code>"" + answers[4] + ""</code>'
testString: 'assert(add12Hours(tests[4]) === answers[4], "Should handel year change. <code>add12Hours("" + tests[4] + "")</code> should return <code>"" + answers[4] + ""</code>");'
Challenge Seed
function add12Hours (dateString) {
// Good luck!
return true;
}
After Test
console.info('after the test');
Solution
// solution required