Account Deleted
Hello Kent, I do really like how you worked this project. I checked the JavaScript logic noticing the following:
Line 91 to 132 contains code that could be optimized, I like how you used the .slice()
method to get the dates, but the switch
structure seems a little bit hardcoded. The create__at
string value, can be passed as an argument to a Date
object, then the .toLocaleString()
method allows you to pull out the values that you specify in different formats and return them as a string value.
// created_at: '2011-01-25T18:44:36Z'
let creationDate = new Date(created_at);
let joinDate = creationDate.toLocaleString('en-GB', { year: 'numeric', month: 'short', day: 'numeric'});
// joinDate: '25 Jan 2011'
Good job and I see you around, happpy coding!
Marked as helpful
@12Kentos
Posted
@alexcumplido
Thanks for the reply, sorry it took me so long to reply to it!
Didn't realize you could handle dates that way. I'll use it in future projects for sure.
Thanks!