Jump to content

perhapsmybe

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by perhapsmybe

  1. On 5/12/2023 at 9:04 PM, Beyondspace said:

    CALL FOR TESTING 🤩

    The Beyondspace date-format snippet has been upgraded, please replace your given snippet with the new one from this URL below

     🌍  Live editor

    image.thumb.png.ec506e73a9747eadd7d8b0b02444920e.png

    🌍 outputFormat supports different kinds of format based on the date string token

    - MM/DD/YYYY

    - DD/MM/YYYY

    - MMM D, YYYY

     🌍 Multilingual website is supported out of the box, check for the support locales value here, for example

    - www.ojala.mx/es/espanol

    - www.ojala.mx/en/english

    - www.ojala.mx/en/ojala-en

    - www.ojala.mx/es/ojala-es

     🌍  Only those date format can support locales. For example instead putting `MM/DD/YYYY`, place `LLL` so it can be auto-converted into different languages

    Format English Locale Sample Output
    L MM/DD/YYYY 08/16/2018
    LL MMMM D, YYYY August 16, 2018
    l M/D/YYYY 8/16/2018
    ll MMM D, YYYY Aug 16, 2018

     🌍  Weglot website is not supported as Weglot has its own mechanism for date time localization, for example

    cc: @mazmac @ocam @yshahi @AdamR @JoelleM @ChiroUp @g-souza @Creatingspaces

     

    Yay! Thank you, this solution works!

  2. 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

    image.png.b4c48c3129f85d74e8a7b01013d54c47.png

    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:
     

     

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.