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

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

171

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

Copy link to clipboard

Copied

LATEST

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

Votes

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