Skip to main content
New Participant
September 5, 2023
Question

Display date field in small caps only

  • September 5, 2023
  • 2 replies
  • 653 views

Hi,

 

I am trying to fix a little issue with a PDF file we use for contracts. I used a personalized format for the date field (dd mmmm yyyy) but unfortunately it keeps capitalizing the month. These documents are in French, and capitalizing the first letter of the month is a grammatical mistake, so I'd like to change it to be displayed in small caps only but I'm falling short on that one. I know I'll probably need some type of script but I'm not well versed in that area, any help would be appreciated!

 

 

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
September 5, 2023

Use this script as a Custom Format Script:

 

var d = util.scand("dd/mm/yyyy", event.value); //récupère la date saisie
if (d == null) { // si la date n'est pas valide ou ne correspond pas au format dd/mm/yyy
app.alert("Merci de saisir une date au format JJ/MM/AAAA");
event.rc = false;
}
else {event.value = util.printd("date(fr){D MMMM YYYY}", d, true)}

 

 

 

 

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
September 5, 2023

Fastoche !

 

util.printd("date(fr){DD MMMM YYYY}", new Date(), true);

 

Acrobate du PDF, InDesigner et Photoshopographe
New Participant
September 5, 2023

Hi JR,

 

Not sure if I'm putting it in the wrong spot, I tried both in validation and calculation (in the properties tab of the date field) and it's not working, does it go somewhere else? Merci 🙂