Rosetta Code: Date format - vague instructions

I wasn’t sure if I should combine this with the other issue with this challenge, but it seems separate.

The instructions give no clue of how to handle single digit months or days. The example has double digits for both:

Example output: ['2007-11-23', 'Friday, November 23, 2007']

So, a camper just complained because:

[ '2021-03-01', 'Monday, March 1, 2021' ]

wouldn’t pass. It will only pass with:

[ '2021-3-1', 'Monday, March 1, 2021' ]

I just thought I’d check and see if this was purposely vague - it seems like such an obvious omission.

The Challenge

I believe it is vague, because Rosetta are vague.

OK, perhaps. I’m not familiar with the relationship between the two - our app and their challenges.

In the past, we have had a mixture of:

  • remain as similar to the official platform as possible
  • tweak the challenges to be more specific, and easier/harder

So, I am not sure if anything will/should be done to change the current lesson. Others might have more preference/insight.

See my comment on the other topic.

If anyone feels we shouldn’t add the additional clarification, then that is fine too.

1 Like

Rosetta version isn’t more specific because it doesn’t need to be. From Rosetta’s perspective both are okay and on the page there are various implementations - with zero-padding in numbers and without.

However since here tests require more specific result, it will be good to either clarify description, how such case should be handled, or change test to accept both.


In that case, I say we should make the tests more flexible to also handle leading zeros on the month and day numbers.

1 Like

It still seems odd to me to have such vagueness in a challenge description, but if the tests can handle both implementations, then that is at least a good improvement and should suffice.