mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 15:32:25 -05:00
[chore] little frontend tweaks (#3852)
* [chore] little frontend tweaks * beep boop * poke * clarify server time
This commit is contained in:
parent
e78e817057
commit
4c9901fc03
6 changed files with 18 additions and 44 deletions
|
|
@ -182,22 +182,22 @@ Array.from(document.getElementsByClassName("plyr-video")).forEach((video) => {
|
|||
video._plyrContainer = player.elements.container;
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const timeTags = document.getElementsByTagName('time');
|
||||
Array.from(timeTags).forEach(timeTag => {
|
||||
const datetime = timeTag.getAttribute('datetime');
|
||||
const currentText = timeTag.textContent.trim();
|
||||
// Only format if current text contains precise time
|
||||
if (currentText.match(/\d{2}:\d{2}/)) {
|
||||
const date = new Date(datetime);
|
||||
timeTag.textContent = date.toLocaleString(undefined, {
|
||||
Array.from(document.getElementsByTagName('time')).forEach(timeTag => {
|
||||
const datetime = timeTag.getAttribute('datetime');
|
||||
const currentText = timeTag.textContent.trim();
|
||||
// Only format if current text contains precise time.
|
||||
if (currentText.match(/\d{2}:\d{2}/)) {
|
||||
const date = new Date(datetime);
|
||||
timeTag.textContent = date.toLocaleString(
|
||||
undefined,
|
||||
{
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue