7 kyu
Date formatter
142LeTysker
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.
If you need a tip to solve this kata (i did), stop trying
Date.toLocaleDateString
or anyDate
method. Use a different approach ;)And IMO, it's not 7kyu
Should be stated in the description that formats are provided
Isn't that already in the description?
Really sorry. I don't know what what description I was reading when I left the comment. I will triple check description next time.
Why I can't use
Date.prototype.toLocaleDateString(loc)
to change the time place. For example, at my vscode ->getDate(1481020142, "ko-KR")
output:2016. 12. 6. but when I test the case. output:2016-12-6 why ???See ZozoFouchtra post below.
approved
I also fixed the author's random tests (it's testing the user solution against... itself, so it's always vacuously true.)
It seems
.toLocaleDateString
doesn' t work (Intl.DateTimeFormat.supportedLocalesOf
returns an empty array ) so I think it would be better to add yourformats
object in "Preload" section to let warriors use it. This way they'll be able to format output strings.May the Code be with you! ; ) )
I guess you're right. I'll add it along with random tests. Thanks for the feedback! =)
For the reference: https://github.com/Codewars/codewars-runner-cli/issues/527
Seems like this was never done? It isn't working for me 4 years later and still very few have completed this kata.