Jump to content

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

Recommended Posts

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

Link to comment
  • Replies 41
  • Views 31.7k
  • Created
  • Last Reply

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

Link to comment

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

Link to comment

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

Link to comment
  • 3 months later...
  • 2 weeks later...

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?

Link to comment

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?

Link to comment
  • 3 months later...

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>

Link to comment

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!

Link to comment
  • 2 months later...
  • 10 months later...

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!!!

Link to comment
  • 2 months later...

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

Link to comment
  • 10 months later...
  • 2 years later...
  • 10 months later...
On 4/15/2020 at 5:31 PM, margothermans said:

Does anyone have a solution for this? The code doesn't seem to work on summaries 😞

what is your site url

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

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.