Skip to main content
Inspiring
October 10, 2017
Question

text field formatted as date

  • October 10, 2017
  • 2 replies
  • 2139 views

Dear all,

I use a german version of Adobe Acrobat XI (Version 11.0220). I like to generate a editable PDF form. On different pages of the form I use a script to set a field as default date to today if is it empty.

I put  the following code in properties of the text field in the last section user defined script:

if(event.value == "")

{

event.value = util.printd("dd. mmmm yyyy", new Date())

}

Unfortunately I like to use a similar script to set only the month name and the year in english for different fields. But I got only german names if I use only mmmm yyyy. Any idea to overcome this?

Any suggestions are welcome.

Thanks in advance and greetings

Hans

This topic has been closed for replies.

2 replies

hmkellerAuthor
Inspiring
October 10, 2017

Dear try67,

I tried

if(event.value == "")

{

event.value = util.printd("date(en){MMMM YYYY}", new Date(), true);

}

but as result I got germen month names:

Januar instead of January and Mai instead of May and so on. What did I wrong?

Bernd Alheit
Community Expert
Community Expert
October 10, 2017

Change the language of Acrobat to English.

hmkellerAuthor
Inspiring
October 10, 2017

Dear Bernd,

I need german and english date format in the same form. Therfore I can't switch to a different language. Your answer doesn't help for my problem. Any other idea?

Cheers

Hans

try67
Community Expert
Community Expert
October 10, 2017

Use this code:

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