-
Posts
3 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by perhapsmybe
-
-
On 3/25/2021 at 10:01 AM, Beyondspace said:
🌍 [16-May-2023] Update
The scirpt has been updated to fix some known issues, the details can be found in the post below
Live editor also available on Beyondspace.studio
〰️ 〰️ 〰️ 〰️ 〰️ 〰️ 〰️ 〰️ 〰️ 〰️ 〰️ 〰️
Update the placement using css
.blog-basic-grid--text { display: flex; flex-wrap: wrap; } .blog-basic-grid--text .blog-more-link { width: 100%; } .blog-basic-grid--text .blog-meta-section { order: 9; }
Update the dateformat using custom code
Please add this snippet into Settings->Advanced->Code Injection to format the date the way you like it
<!-- Fix inconsistent blog date format on Squarespace 7.1 template --> <!-- Squarespace Forum 03-08-2021 --> <script src="https://stevenlevithan.com/assets/misc/date.format.js"></script> <script> document.addEventListener('DOMContentLoaded', function() { var dateformat = "mm-dd-yyyy"; var pubdate = document.querySelectorAll("time[datetime], time[pubdate], time.blog-meta-item--date"); for (var i = 0; i < pubdate.length; i++) { var d = new Date(pubdate[i].getAttribute("datetime") || pubdate[i].innerText); if ( pubdate[i].classList.contains('blog-meta-item--date') ) { d = new Date(document.querySelector('[itemprop="datePublished"]').getAttribute("content").split("T")[0]); } pubdate[i].innerHTML = d.format(dateformat); } }); </script>
The variable dateformat currently set with "mm-dd-yyyy", but you can change to different format (reference here)
These are some more format that supported:
"mm-dd-yyyy" --> 02-25-2021
"dd-mm-yyyy" --> 25-02-2021
"mm/dd/yyyy" --> 02/25/2021
"mmm dd yyyy" --> Feb/25/2021
Hello..
I tried using this code but it didn't work. Maybe because I have a code injection of:<style> .blog-meta-item--tags { display: none; } </style>
I tried putting it on the top and inside of <style> and</style> but it didn't work so I just deleted it.
Is there any workaround for that?
Website Post Sample: https://perhapsmybe.com/post/drowning
UPDATE: Solution found here:
[FreeShare] Date display format options on all pages
in Customize with code
Posted
Yay! Thank you, this solution works!