6 kyu
Pretty date
104 of 885burce
Loading description...
Date Time
Fundamentals
View
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.
the title attracted me
fork adding sample and random tests to JS, + upgrading to Node 18 and chai assertions
(author is gone)
Approved
python new test framework is required. updated in this fork
Approved 👍
Author's python solution assume that arguments from diapason 84600 - 86399 (23 hours 30 minutes 00 seconds - 23 hours 59 minutes 59 seconds) must to return '0 days ago'
This comment has been hidden.
In JavaScript / Python, we are given a plain Number / int though, not an object
Resolved by description edit in saudiGuy fork
no sample tests in JavaScript
Resolved by your fork
Nice kata!
I've got this in Python random tests:
IMO it's not correct.
Regards,
suic
Resolved in this fork
issue:
There is some internal array named "times" which is initialized between the preset tests and the randomized tests. It was conflicting with my own list named 'times', causing my code to appear to magically stop working partway through testing. It would be nice if there was a warning or something not to use that name, as this issue caused me to waste plenty of my time with pointless debugging.
This comment has been hidden.
This occured to me too with the value 170315.
Fixed, thanks MMMAAANNN :)
Great, thanks.
This comment has been hidden.
Python translation submitted :)
I would add random cases to each language and can do it if you wish, but you of course have the last word :)
Edit: oh, and kata green-lit.
As MMMAAANNN said, there is an issue with Python test cases, and still no correction 8 months after.
And now it is fixed; sorry guys, but regrettably I don't get notified if none is posting under a comment of mine.
Thanks for letting me know :)
Can you please take another look at this? The problem still persists, as far as I can see.
Also, it would be great if you add some random cases to the JS version too!
Mh, probably there was some trouble when I saved the edit; redone, refreshed the page and it seems to stay. Thanks again for your patience :)
@GiacomoSorbi
,Python 3 isn't available because of the division sign used in your solution,
sol
. Very simple fix,/ -> //
(four times, once each for "minute", "hour", "day", "week").Thanks!
JS translation kumited. (Description modified)
Major Issues
The description is not sufficiently detailed. Based on assumptions derived while trying to pass this kata, I believe the following details need to be added:
Minor Issues
The formatting in the description can be cleaned up a little, e.g.,
(see Description Markdown Field for the markdown; I can't figure out the markdown for showing markdown)
Optional Additions
Times in the future, with the suffix "from now" instead of "ago" would be an interesting addition and isn't too much more difficult to deal with.
I'm a fan of random test cases, so I'll also recommend adding a few of them.
Thanks for the suggestions!
If you think of any random test cases/edge cases, I'd definitely like to add some.
It's a nice kata. And my solution was unneccesary complicated. :-)
Did you consider adding times in the future as well? Like "in 3 hours" or so?
With the solution I have, it'd just be duplicating everything (with negatives & 'in' instead of 'ago') - unless someone comes up with a solution that incorporates it I won't worry about it for now! Thanks though :)