Jump to content

Changing text in Events thumbnail

Recommended Posts

Can anyone advise me on how can I access the month name inside the Event thumbnail so I can change the string to another one (localised to the language not currently supported by SQSP)?  (see the picture)

I managed to change most of the date instances in Events and Blog pages via datetime handle, but being a non-programmer I struggle with that thumbnail.

Basically all I need is a function that will return a number of the month mentioned in the thumbnail (e.g. "3" for "MAR") --- missed bit od code marked below as *******

 

<script>
var month=new Array(12);
month[0]="LED"; month[1]="ÚNO"; month[2]="BŘE"; month[3]="DUB"; month[4]="KVĚ"; month[5]="ČER";
month[6]="ČVC"; month[7]="SRP"; month[8]="ZÁŘ"; month[9]="ŘÍJ"; month[10]="LIS"; month[11]="PRO";

Y.use('node', 'node-load', function(Y) {
Y.on('domready', function() {

Y.all('div.eventlist-datetag-startdate--month').each(
function() {
var mdate = new Date(this.getAttribute(************));
this.setHTML(month[mdate.getMonth()]);
});
});
</script>

*thanks*

Snímek obrazovky 2020-02-07 v 11.17.45.png

Link to comment
  • 1 month later...
  • Replies 1
  • Views 223
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.