Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13691149
localdate.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
697 B
Subscribers
None
localdate.js
View Options
function
toLocalDate
(
dateEl
,
displayEl
)
{
var
d
=
new
Date
(
dateEl
.
getAttribute
(
"datetime"
));
displayEl
.
textContent
=
d
.
toLocaleDateString
(
navigator
.
language
||
"en-US"
,
{
year
:
'numeric'
,
month
:
'long'
,
day
:
'numeric'
});
}
// Adjust dates on individual post pages, and on posts in a list *with* an explicit title
var
$dates
=
document
.
querySelectorAll
(
"article > time"
);
for
(
var
i
=
0
;
i
<
$dates
.
length
;
i
++
)
{
toLocalDate
(
$dates
[
i
],
$dates
[
i
]);
}
// Adjust dates on posts in a list without an explicit title, where they act as the header
$dates
=
document
.
querySelectorAll
(
"h2.post-title > time"
);
for
(
i
=
0
;
i
<
$dates
.
length
;
i
++
)
{
toLocalDate
(
$dates
[
i
],
$dates
[
i
].
querySelector
(
'a'
));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 27, 10:21 PM (22 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3593854
Attached To
rWF WriteFreely
Event Timeline
Log In to Comment