FreeTube
FreeTube copied to clipboard
PublishedText gets created using only one method. (toLocaleDateString…
…) (#2439)
The Published on String is now created in a (more) concise way
Important note We may remove your pull request if you do not use this provided PR template correctly.
Pull Request Type Please select what type of pull request this is:
- [X] Bugfix
- [ ] Feature Implementation
- [ ] Documentation
- [ ] Other
Related issue closes #2439
Description
There were two methods and two variables for creating the published ... min/hours/days string. One that was written in utils and the Date.toLocaleString.
As well there were many conditionals that should produce all the same result. Should this solution be viable, the translation String and the utils method could also be purged.
Edit:
I realized that the real bug lay in that toLocalePublicationString
relied on the api giving back a string in english. But apparently the locale is handled differently and is not affected by the language settings. So i think, it is more reliable to determine unit and number based on the published timestamp.
Testing (for code that is not small enough to be easily understandable) I tried different language settings on different Pages.
Desktop (please complete the following information):
- OS: Debian
- OS Version: 11
- FreeTube version: latest
Additional context I noticed that the recommended videos have no publication data associated.
Just some minor changes
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR was closed because it has been stalled for 14 days with no activity.