Skip to main content
Inspiring
September 29, 2024
Answered

Passport Expiry date

  • September 29, 2024
  • 2 replies
  • 772 views

Hello 

Appreciate help to create java script 

When I put issue date of passport  it will appear automatically date of Expiry for passport 

For example

 If insert Date of issue: 29/5/2024

 Feild of Date of Expiry shown automatically: 28/5/2031

Regards, 

This topic has been closed for replies.
Correct answer PDF Automation Station

It looks like the expiry date is 7 years from the issue date, but you don't say that.  Is it?  Enter the following custom calculation script in the Date of Expiry Field:

var issue=this.getField("Date of issue").value;
if(!issue)
{event.value=""}
else
{
var date=issue;
var d = util.scand("dd/mm/yyyy", date);
d.setFullYear(d.getFullYear() +7);
d.setDate(d.getDate()-1)
event.value = util.printd("dd/mm/yyyy",d);
}

2 replies

Adobe Employee
October 8, 2024

Hi @ali_3480 

Are you able to make toe correct JS now?

ali_3480Author
Inspiring
October 8, 2024

Yes dear 

It is working

PDF Automation Station
Community Expert
Community Expert
September 29, 2024

It looks like the expiry date is 7 years from the issue date, but you don't say that.  Is it?  Enter the following custom calculation script in the Date of Expiry Field:

var issue=this.getField("Date of issue").value;
if(!issue)
{event.value=""}
else
{
var date=issue;
var d = util.scand("dd/mm/yyyy", date);
d.setFullYear(d.getFullYear() +7);
d.setDate(d.getDate()-1)
event.value = util.printd("dd/mm/yyyy",d);
}