Problem with date and languages

Hello everybody!

So… After reading this post and making some research, I can’t make the date be displayed in spanish.

First, I must say I could make it work on a blank page I created using the information I got on the post, yet when trying to implement it on my website I cannot make it work…

It keeps displaying the date in English, could it be the bootstrap theme I’m currently using? I using Hyper theme bought on https://coderthemes.com/

Thanks!

Did you include the Moment framework on your page?

Yes. I did. I use php include files, so I included on the principal web page, both the moment on the body and the scripts on the head.

Hi Carlos, did u try it like this: var.formatDate("dd-MM-yyyy") ?

Yes… I tried but using “dddd” because I need to get the date name. Instead of showing Martes (Tuesday in Spanish) it shows Tuesday…

I’ve implemented the code without problems in a blank page and worked correctly. It appears to be the theme I’ve downloaded (which would be very weird)

Ok, its your configuration of moment like this:

Yes, I did all I did on the blank page it worked

Ok i recreated the code and yes i can confirm it works:

I think u should try it again in your blank page but with your bootstrap theme, and see what happens.

1 Like

I know nothing about the topic except to say, have you tried <html lang="es">?

Didn’t work…

@Max_Saravia already shows that it works. Make sure you have the moment framework with all locales and then add the moment component on the page and set the locale to es. Also the formatDate2 formatter is needed from the other post, put it in a script block or in a file and include it also on the page. Now you can format the date with the formatDate2 formatter and it should show in spanish.

@salvuccicarlos has got it working in a blank document, just cannot get it to work for the template. To me this sounds like something in the template does not rhyme.

A link to the site may help us to figure it out. Alternatively, you could start adding parts from the template to the blank page until the outcome breaks down.