Jump to content

Rule to translate date from English to French


maryj

Recommended Posts

If you run a quick search through the forums I think you'd be able to find most of the answers to your questions. I found this code from this post where someone was looking to convert the date to Spanish.

 

After making a few edits:

function FrenchDate(myDate)
{
   var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];

   var month = months[myDate.getMonth()];
   return myDate.getDate() + " " + month + " " +  myDate.getFullYear();
}

return FrenchDate(DateFromString(Field("[color="Red"]YOURDATEFIELD[/color]")));

 

Of course, I don't parler français so you'll need to translate the names of the months within the "months" array before you compose your file.

Link to comment
Share on other sites

Thank you!

 

When I paste this into the rule:

 

var months = ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'];

 

It turns into this:

 

var months = ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'];

 

Is there a way to get the umlauts to show up correctly in the rule and in the final variable field?

 

Thanks,

 

Mary

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...