Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old January 6th, 2020, 08:56 AM
msteinberger msteinberger is offline
Forum n00b
 
Join Date: Aug 2016
Posts: 9
Default Re: Format Date in Spanish

Thank you! I ended up with this as my final rule. It displays the date in English or Spanish based on a language column in the data as well as a predetermined date that is also in the data:

function SpanishDate(myDate)
{
var months = ['enero','febrero','marzo','abril','mayo','junio',' julio','agosto','septiembre','octubre','noviembre' ,'diciembre'];
var letterdate = Field("letter date")
var month = months[myDate.getMonth()];
return myDate.getDate() + " de " + month + " " + myDate.getFullYear();
}

return (Field("language") == "S") ? SpanishDate(DateFromString(Field("letter date"))) : FormatDate(DateFromString(Field("letter date")), 'lm d, yyyy');
Reply With Quote
Reply

Tags
date, format, spanish

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:19 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.