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

Blog Post: Translate date format and months from English to another language

Question

I am looking for a way to change the format of dates in blog posts (contained in the meta field of blog posts). I am developing a Swedish language website and would therefor like to change months from text to numeric (for example: change “March” to “03”) or from English to Swedish (change “March” to “mars”).

Is this possible and if so how? I am willing to use JavaScript or whatever is necessary.

Edited by CRM114
Updated title

Share this post


Link to post

Recommended Posts

  • 0

how do you change the date format on forms. I need DD/MM/YYYYOrDD/MONTH/YYYY

The US dates are feeding into my calender and are screwing up my bookings. January 12th 2015 is becoming 1st Dec 2015.

Many Thanks

Share this post


Link to post
  • 0

how do you change the date format on forms. I need DD/MM/YYYYOrDD/MONTH/YYYY

The US dates are feeding into my calender and are screwing up my bookings. January 12th 2015 is becoming 1st Dec 2015.

Many Thanks

Share this post


Link to post
  • 0

how do you change the date format on forms. I need DD/MM/YYYYOrDD/MONTH/YYYY

The US dates are feeding into my calender and are screwing up my bookings. January 12th 2015 is becoming 1st Dec 2015.

Many Thanks

Share this post


Link to post
  • 0
Guest

I have tried all of the suggested options. Not a single one worked with the Wells theme. Why is it so hard for Squarespace to offer a working option to localise your site?

Share this post


Link to post
  • 0

If you just want to do a quick formatting, e.g. move fields around in the date field I used some jQuery to move the elements around, only useful for changing the order.

For example this moves the month over, changing it to DD MM YYYY.


$(document).ready(function () {
   dateFormat();
})

function dateFormat () {

       var $date = $('.sqs-col-6').last().find('.date');

       // find and kill month
       var $month = $date.find('.month');
       $date.find('.month').remove();

       // reinsert month behind day
       $month.insertAfter($date.find('.day'))
}

Just added the script and jQuery to a code block below the form.


<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.js'></script>
<script src="https://s3-ap-southeast-2.amazonaws.com/judy-nunn.com-assets/form.js"></script>

Share this post


Link to post
  • 0

I think i'm missing something, I'm using Bedford template, when I put the code at the right place, save & reload, nothing seem to change ? any sugestion

Thank you

Share this post


Link to post
  • 0

This code worked great for my actual blog, but I've set up the website so the blog is viewed through a List Summary Block on a page (Flatiron template). On that page the English date remains, even if I put the code in the page header code injection. Any workarounds? Thanks!

Share this post


Link to post
  • 0
Guest

Very good script indeed!

Just one thing though, I have a problem getting the Summary to show blog post's dates to french...

Anyone got this problem? On my homepage, I put a Summary and chose BLOGS as content. The blog titles are fine but the date is still in english.

Help :) Thanks alot!!!

Share this post


Link to post
  • 0
Guest

Just back with the same question above, anyone tried to translate dates on Summary's?Here's a screenshot of one. The text under the summary has date and author. The date is english (the month name) and can't find a way to translate it. That's the only item I couldn't translate.

alt text

screen-shot-2017-03-03-at-092529.png.39e006052b3bcffb3d8cf01514dac844.png

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...