7 kyu
Date Format Validation
543 of 1,043Peter Rhodes
Loading description...
Regular Expressions
Strings
Fundamentals
View
Career Accelerator
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Fixed and sample tests like
001-02-2016 00:00
and21-12-2013 02:224
should be added across all languagesRandom tests should generate cases of 3 or more trailing and leading digits above
Reference solution should be updated (if required) to accomodate tests above
Implemented in JS & Ruby
python new test framework is required. updated in this fork
Ruby 3.0 should be enabled.
Enabled in this fork
Specify how strict the format should be. The description:
"...return true if the input is in the following date time format 01-09-2016 01:20..."
is not clear enough whether it refers to an actual valid date format or not.
For instance, it's not clear whether "99-99-9999 99:99" and "00-00-0000 00:00" are considered valid.
At least, you can mention something like:
"It doesn't reflect an actual date, it's just a date format. Which means, "99-99-9999 99:99" and "00-00-0000 00:00" are valid"
This comment has been hidden.
This date strigified format is
valid
, but not the Date itself. And issue about description ambiguity has been raised above and below, closing...( JS, possibly others )
"001-02-2016 00:00"
is supposed to be a valid date ?!? Aren't you forgetting^$
somewhere?Reraised above with more detail. Fixed tests for trailing additional digits should also be added
Python:
WTF!??
And why isn't this even raised as an issue after 74 completions??? 8-XOK, I just read the message below. But just putting a "date format validation" in the title is clearly not enough. an invalid date value with a valid "formatting" could also be considered an invalid format overall. So you should update the description too, explainning fully what you really want.
This kata is very misleading in my opinion. It should state it's all about format and not actual date. It's not date validation - it's date format validation.
I have changed this now to 'Date Format Validation'. Thank you.
Thank you very much :) satisfaction changed to very, good kata, I liked it!
Indeed I falled into the same trap. Time inputs are allowed which do not make any sense like: 26:87
I suggest to add a test case, so that it can be recognized from the beginning that this one leads to a "True" result.
Just because you changed the title to include the word Format doesn't mean anything is clear. You should update the description to explain what you're looking for.
Ruby translation still pending: try cliccking on the language buttons, then "add new" to see it. Cheers!
Ruby and Python translations submitted :)
Thank you Giacomo :)
My pleasure :)
And feel free to call me in a few days, when we have a few more Python and Ruby solution going, to approve the kata.
Ok no problem :)
Approved Ruby translation, too
Thanks :)
This comment has been hidden.
The dates check the format of the date rather than actual date. The way that my random test work means that some of the dates are not possible, I didn't think that anyone would mind about this. I will change it.
Ok I have made the changes to the random tests now, I hope you approve.
@Peter Rhodes I do mind about this. I'll raise an issue for it.