Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function timeIta() {
- document.body.querySelectorAll("time").forEach(function(e) {
- let dt = new Date(e.dateTime);
- let [d, g, o] = [
- dt.toLocaleDateString("en-GB"),
- dt.toLocaleString("it-IT", {
- weekday: "short"
- }),
- dt.toLocaleTimeString("it-IT")
- ];
- e.innerText = `${d} (${g[0].toUpperCase() + g.slice(1)}) ${o}`;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement