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
Fix Part of #8668: Add JsDocs to date-time-format file #10814
Fix Part of #8668: Add JsDocs to date-time-format file #10814
Conversation
Assigning @bansalnitish for code owner reviews. Thanks! |
Hi @bansalnitish , have you had time to look at this? Is it a problem that not all ci tests pass? I have trouble understanding why the tests fail. |
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.
Hi @linnhallonqvist, Took a pass!
@@ -45,17 +53,32 @@ export class DateTimeFormatService { | |||
return moment(date).format('MM/DD/YY'); | |||
} | |||
} | |||
// Returns date along with time. | |||
/** | |||
* This function converts a millisecond date to a human-readable date |
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.
Could you please replace human-readable with the exact format like 'MMM D HH:mm A'
?
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.
Can you please merge the latest develop with your branch once and see if the tests pass?
I have adressed your comments and merged developed with my branch. Hope it looks better! @bansalnitish
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.
Done
// local datetime representation has the same year as the current date. | ||
// Otherwise, returns the full date (with the year abbreviated). | ||
/** | ||
* This function returns just the time if the local datetime representation |
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.
Remove the word just
. Also, can you frame it like The function returns X if Y. Else if A, it returns B. Else, it returns C
?
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.
Done
* if the local datetime representation has the same year as the current | ||
* date. Otherwise, returns the full date (with the year abbreviated). | ||
* @param {number} millisSinceEpoch - milliseconds since Epoch | ||
* @returns {string} - The time if the local datetime representation has the |
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.
Ditto for this. Also, I would say adding the complete description once in the main function description. Here you could simply say returns a date or something.
We should not add the same description in the return as well as the function definiton.
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.
Done
getLocaleDateTimeHourString(millisSinceEpoch: number): string { | ||
let date = new Date(millisSinceEpoch); | ||
return moment(date).format('MMM D HH:mm A'); | ||
} | ||
// Returns just the date. | ||
/** | ||
* This function converts a millisecond date to a human-readable date. |
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.
Ditto for the human-readable.
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.
Done
Can you please merge the latest develop with your branch once and see if the tests pass? |
Hi @linnhallonqvist, Can you please reply to the open comments once its resolved? (Following the wiki guidelines) Also, make sure to ping the reviewer once it's ready for review! |
@srijanreddy98, Can you please review this PR? |
Hello @DubeySandeep ! Done, sorry for missing that. Also I'm not sure what is meant by "submit the review to add all your messages to the main thread"? |
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.
LGTM! -- thanks @linnhallonqvist.
Unassigning @srijanreddy98 since they have already approved the PR. |
@linnhallonqvist congrats on getting your first PR merged. |
Overview
Essential Checklist
PR Pointers