Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Displaying Inputted Date in Multiple Formats Issues

New Here ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

Hello! I'm encountering an issue when showing a user-selected date in multiple formats. At the beginning of the form, the user can select the date from the calendar dropdown. Later on in the form, I need to display this selected date as dd in one field, mm in another field, and yyyy in the last. For some reason though the custom calculation script I'm using is only working for dates before August 11th, and I'm not sure why it's not allowing me to calculate any other dates. Below is the script I'm using: 

 

var s = this.getField("Date").valueAsString;   //"Date" is what I've named the first date field.

if (s=="") event.value = "";

else { var d = util.scand("dd-mm-yyyy", s); d.setDate(d.getDate()-0); event.value = util.printd("dd", d); }

 

Any ideas of what might be going wrong here? Thanks in advance!

TOPICS
Create PDFs, JavaScript, PDF forms

Views

34

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 20, 2021 Aug 20, 2021

Copy link to clipboard

Copied

LATEST

What format does you use at the field "Date" ?

Likes

Translate

Translate

Report

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