Skip to content
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

Switch comments to calculatePublishedDate and getRelativeTimeFromDate #6086

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

absidue
Copy link
Member

@absidue absidue commented Nov 3, 2024

Switch comments to calculatePublishedDate and getRelativeTimeFromDate

Pull Request Type

  • Refactor

Description

Published dates for videos and community posts were already using the calculatePublishedDate and getRelativeTimeFromDate functions, comments however were still using the old toLocalePublicationString function. This pull request switches the comments over to the newer functions too, which means that the x 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 the Video.Published.* key), because the newer functions use the built-in Intl.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

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 94fe62a

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 3, 2024 17:37
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 3, 2024
ChunkyProgrammer added a commit to ChunkyProgrammer/FreeTube that referenced this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: waiting for review For PRs that are complete, tested, and ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants