7 kyu

Date Format Validation

543 of 1,043Peter Rhodes
Description
Loading description...
Regular Expressions
Strings
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ejini战神 Avatar
    • Fixed and sample tests like 001-02-2016 00:00 and 21-12-2013 02:224 should be added across all languages

    • Random tests should generate cases of 3 or more trailing and leading digits above

    • Reference solution should be updated (if required) to accomodate tests above

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • user9644768 Avatar

    Ruby 3.0 should be enabled.

  • farhanaditya Avatar

    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"

  • runzhi214 Avatar

    This comment has been hidden.

  • JohanWiltink Avatar

    ( JS, possibly others )

    "001-02-2016 00:00" is supposed to be a valid date ?!? Aren't you forgetting ^$ somewhere?

  • Blind4Basics Avatar

    Python:

    Testing for '13-18-8014 88:18'
    It should work for random inputs too: False should equal True
    

    WTF!?? And why isn't this even raised as an issue after 74 completions??? 8-X

    OK, 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.

  • gabbek Avatar

    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.

  • GiacomoSorbi Avatar

    Ruby translation still pending: try cliccking on the language buttons, then "add new" to see it. Cheers!

  • GiacomoSorbi Avatar

    Ruby and Python translations submitted :)

  • ZozoFouchtra Avatar

    This comment has been hidden.