Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Translate blog post dates


MomMe

Question

11 answers to this question

Recommended Posts

  • 0

Is this on the individual blog posts like https://www.mom-me.dk/blog/blog-post-title-four-r3kyz?

 

About Paul: Circle Community Leader who values honesty, transparency, respect and appreciation ♥.
Work: Squarespace Expert and founder of 
SF Digital, a company dedicated to improving Squarespace websites by building the features Squarespace didn't include™. See our range of extensions for Squarespace to improve your store.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Link to comment
  • 0
On 11/8/2021 at 4:28 PM, MomMe said:

It should be on all blog posts, also future ones.

Try adding to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  const translate = {
    Jan: "New Jan",
    	Feb: "New Feb",
    	Mar: "New Mar",
    	Apr: "New Apr",
    	May: "New May",
    	Jun: "New Jun",
    	Jul: "New Jul",
    	Aug: "New Aug",
    	Sep: "New Sep",
    	Oct: "New Oct",
    	Nov: "New Nov",
    	Dec: "New Dec"
}
const translate1 = {
    	January: "New Januanry",
    	February: "New February",
    	March: "New March",
    	April: "New April",
    	May: "New May",
    	June: "New June",
    	July: "New July",
    	August: "New August",
    	September: "New September",
    	October: "New October",
    	November: "New November",
    	December: "New December"
}
const day = {
    
    Monday: "New Monday",
    Tuesday: "New Tuesday",
    Wednesday: "New Wednesday",
    Thursday: "New Thursday",
    Friday: "New Friday",
    Saturday: "New Saturday",
    Sunday: "New Sunday"
}
$(document).ready(function() {
 $('time.blog-meta-item--date span').each(function(i, e) {
     const text = $(e).html()
     $(e).html(translate[text])
 })
 
})
S.fn.init [document]
const translate = {
    Jan: "New Jan",
    	Feb: "New Feb",
    	Mar: "New Mar",
    	Apr: "New Apr",
    	May: "New May",
    	Jun: "New Jun",
    	Jul: "New Jul",
    	Aug: "New Aug",
    	Sep: "New Sep",
    	Oct: "New Oct",
    	Nov: "New Nov",
    	Dec: "New Dec"
}
const translate1 = {
    	January: "New Januanry",
    	February: "New February",
    	March: "New March",
    	April: "New April",
    	May: "New May",
    	June: "New June",
    	July: "New July",
    	August: "New August",
    	September: "New September",
    	October: "New October",
    	November: "New November",
    	December: "New December"
}
const day = {
    
    Monday: "New Monday",
    Tuesday: "New Tuesday",
    Wednesday: "New Wednesday",
    Thursday: "New Thursday",
    Friday: "New Friday",
    Saturday: "New Saturday",
    Sunday: "New Sunday"
}
$(document).ready(function() {
 $('time.blog-meta-item--date span').each(function(i, e) {
     const text = $(e).html()
     $(e).html(translate[text])
 })
 $('time.blog-meta-item--date span').each(function(i, e) {
     let text = $(e).html()
     for(let key in translate) {
         text = text.replace(key, translate[key])
     }
     for(let key in day) {
         text = text.replace(key, day[key])
     }
     console.log(text)
     $(e).html(text)
 })
})
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
On 11/19/2021 at 3:00 AM, MomMe said:

Sorry tuanphan, it didn't work....

It looks like you removed date. Do you still need help?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
7 hours ago, MomMe said:

If it can be solved, then yes. I will prefer the date to be there but not in english 😉

Try to enable again we can suggest using Intl API for dateformat

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
2 hours ago, MomMe said:

It's enabled again 😉 

What language and date format

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
4 hours ago, MomMe said:

It's enabled again 😉 

Is it correct

image.png.09c53416c0fc350bf5e91ba316f74186.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...