Switch comments to calculatePublishedDate
and getRelativeTimeFromDate
#6086
+9
−1,622
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Switch comments to
calculatePublishedDate
andgetRelativeTimeFromDate
Pull Request Type
Description
Published dates for videos and community posts were already using the
calculatePublishedDate
andgetRelativeTimeFromDate
functions, comments however were still using the oldtoLocalePublicationString
function. This pull request switches the comments over to the newer functions too, which means that thex unit ago
published date display should be the same again across the app. As the old function is now unused we can remove it as well as the translation strings that it was using (it also removes the other unused strings under theVideo.Published.*
key), because the newer functions use the built-inIntl.RelativeTimeFormat
class.@ChunkyProgrammer You'll need to make the same adjustment in your Piped pull request as that currently uses the function that this pull reqeust removes.
This pull request also fixes the storyboard issue that was introduced in the jsdoc pull request so that this pull request can actually be tested.
Testing
Check that the published dates show up on comments with both API backends
Desktop