You need to check spans which include the days when Daylight Savings Time begins and ends. Solutions which naively add 24-hour intervals will give the wrong result.
Test.assertEquals(nextFiveDays(newDate(2012, 10, 2)),
'11/3/2012, 11/4/2012, 11/5/2012, 11/6/2012, 11/7/2012',
'Should give correct result when Daylight Savings Time ends');
Test.assertEquals(nextFiveDays(newDate(2013, 2, 7, 23, 59)),
'3/8/2013, 3/9/2013, 3/10/2013, 3/11/2013, 3/12/2013',
'Should give correct result when Daylight Savings Time begins');
Yes, that's not debugging, that's rewriting) But at least it's another good chance to get along with date object)
Debuging? It seems like rewrite it.
This is a bit harder than what you tried. it should work with
say(word1)(word2)
.Thank you, I thought there could be many solutions))
Use
return
, notconsole.log
, and English please :PThis comment is hidden because it contains spoiler information about the solution
JS: No random tests
Approved
Similar (but somehow different) to this kata
No sample tests.
Typescript translation added, please approve.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You should include how you pass the date parameter
You need to check spans which include the days when Daylight Savings Time begins and ends. Solutions which naively add 24-hour intervals will give the wrong result.
I know, I know... dates are hard.
Loading more items...