Change format of date with Javascript within Acrobat Pro

Viewed 56

I want to add a Send-Button in an PDF using Acrobat Pro and some Javascript. The input of the endDate value is either in format yyyy-mm-dd, mm/dd/yyyy or any other.

I want to change that format within my code to "yyyymmdd". How can I do that independently from the input format?

var firstName = this.getField("Vorname").value;
var lastName = this.getField("Nachname").value;
var endDate = this.getField("bis Datum").value;
var mailtoUrl = "mailto:mail@example&subject=MySubject" + firstName + "%20" + lastName + "&body=MyBody" + lastName + "_" + firstName + "_" + endDate;
this.submitForm({
    cURL: mailtoUrl,
    cSubmitAs: "PDF"
});

Thank you very much.

0 Answers
Related