Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Form date language to English

New Here ,
Jun 11, 2021 Jun 11, 2021

Hello,

I have Adobe Acrobat Pro DC English version. I created a form with field fomated as a Date with dd-mmm-yyyy. Document language is set to English but date picker is all over the world. Problem is that for date picker it is showing in there local laguage. After the date picker enter date and share the PDF form, field is populated in different laguage for me (Ex: Spanish,Japanese). I want to restrict the date language to English for all.

How can I fix this? Do i need to write any validation script for this ?

Thank you.

TOPICS
JavaScript , PDF forms
3.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2021 Jun 11, 2021

You can't. If you don't want it localized then don't set the month to be textual, only as a number.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2021 Jun 11, 2021

Your salvation may come with the ISO standard: yyyy-mm-dd

 

In any case this comics was made for you  😉

 

iso_8601

 

https://xkcd.com/1179/


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2021 Jun 11, 2021

There's always an XKCD...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2021 Jun 11, 2021

The secret is that in this case you should not use the Date format, nor any other "format" and use this as a Validation script:

 

// VALIDATION SCRIPT
var d = util.scand("yyyy-mm-dd", event.value);
if (d == null) {
app.alert("Please enter a Date at the yyyy-mm-dd format.");
event.rc = false;
}

 

This script works with any date format, just edit what is orange.




Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2021 Jun 11, 2021

How is that different from using the Date format with that pattern? The issue is they're using "mmm" instead of "mm".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2021 Jun 11, 2021

Apart the iso date format, you can add an invisible field.
In validation of the date field you type:
if (event.value!="") this.getField("invField").value=util.scand("dd-mmm-yyyy", event.value);
else this.getField("invField").value="";
and you create a document level script:
if (this.getField("invField").value!="") this.getField("theDate").value=util.printd("dd-mmm-yyyy", new Date(this.getField("invField").value));

You can try changing the language of your Acrobat Pro software.
@+

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2021 Jun 12, 2021

"How is that different from using the Date format with that pattern? The issue is they're using "mmm" instead of "mm"."

So he should use:

 

// VALIDATION SCRIPT
var d = util.scand("dd-mmm-yyyy", event.value);
if (d == null) {
app.alert("Please enter a Date at the dd-mmm-yyyy format.");
event.rc = false;
}


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2021 Jun 12, 2021

That doesn't solve the problem that the end-user could still enter the month name in their local language...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2021 Jun 13, 2021
LATEST

So the OP should loop to my first answer.  🙂

 

 


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines