forked from rDrama/rDrama
use snek's formatDate everywhere
parent
755cfbf335
commit
9c3f520aa7
|
@ -1,8 +1,11 @@
|
|||
function pinned_timestamp(id) {
|
||||
const el = document.getElementById(id)
|
||||
const time = new Date(parseInt(el.dataset.timestamp)*1000)
|
||||
const pintooltip = el.getAttribute("data-bs-original-title")
|
||||
if (!pintooltip.includes('until')) el.setAttribute("data-bs-original-title", `${pintooltip} until ${time}`)
|
||||
if (!pintooltip.includes('until'))
|
||||
{
|
||||
const time = formatDate(new Date(parseInt(el.dataset.timestamp)*1000))
|
||||
el.setAttribute("data-bs-original-title", `${pintooltip} until ${time}`)
|
||||
}
|
||||
}
|
||||
|
||||
/** @type {HTMLImageElement} */
|
||||
|
|
|
@ -57,7 +57,7 @@ else
|
|||
}
|
||||
|
||||
function badge_timestamp(t) {
|
||||
const date = new Date(t.dataset.until*1000);
|
||||
const date = formatDate(new Date(t.dataset.until*1000));
|
||||
const text = t.getAttribute("data-bs-original-title")
|
||||
t.setAttribute("data-bs-original-title", `${text} ${date.toString()}`);
|
||||
t.removeAttribute("onmouseover")
|
||||
|
|
|
@ -262,9 +262,11 @@
|
|||
|
||||
{% if v.flairchanged %}
|
||||
<script>
|
||||
const date = new Date({{v.flairchanged}}*1000).toString();
|
||||
const text = ` - Your flair has been locked until ${date}`
|
||||
document.getElementById('customtitlebody').value += text;
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const date = formatDate(new Date({{v.flairchanged}}*1000));
|
||||
const text = ` - Your flair has been locked until ${date}`;
|
||||
document.getElementById('flair-body').value += text;
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue