-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment component #55
base: B_master
Are you sure you want to change the base?
Conversation
src/components/Comment.js
Outdated
function Comment({userName, text, creationDate, imgUrl}) { | ||
|
||
var day = creationDate.getDate(); | ||
var month = creationDate.getMonth(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMonth
zwraca liczbę z zakresu 0-11 - styczen = 0, luty = 1 => z tego powodu trzeba zrobić +1
src/components/Comment.js
Outdated
<p className="user">{userName}</p> | ||
<p className="text">{text}</p> | ||
</div> | ||
<p className="date">{day + "-" + month + "-" + year + " " + h + "h " + m + "min"}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polecam użyć składni z ` i ${} - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
No description provided.