Highlighted

How to auto calculate date fields from an inputted date

Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

Good Morning,

 

I am updating a form that requires dates to be inputted. It has a date range of 7 days starting on Sunday and ending on Saturday of every week. These are typically filled out the week after the stated date range. The first instances of a date is in the header with a period date range (from DATE to DATE). For the sake of argument lets say the date range is from 09/13/2020 to 09/19/2020. It then has a table that breaks down the range into a row for each day:

Sunday

09/13/2020___________

Monday

09/14/2020___________

....

....

Saturday

09/19/2020___________

 

Is there a way to format or calculate all of the dates after the first is inputted by the user so they don't have to select each drop down and input it themselves?

 

 

 

 

TOPICS
Create PDFs, How to, PDF forms

Views

97

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

How to auto calculate date fields from an inputted date

Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

Good Morning,

 

I am updating a form that requires dates to be inputted. It has a date range of 7 days starting on Sunday and ending on Saturday of every week. These are typically filled out the week after the stated date range. The first instances of a date is in the header with a period date range (from DATE to DATE). For the sake of argument lets say the date range is from 09/13/2020 to 09/19/2020. It then has a table that breaks down the range into a row for each day:

Sunday

09/13/2020___________

Monday

09/14/2020___________

....

....

Saturday

09/19/2020___________

 

Is there a way to format or calculate all of the dates after the first is inputted by the user so they don't have to select each drop down and input it themselves?

 

 

 

 

TOPICS
Create PDFs, How to, PDF forms

Views

98

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
Sep 14, 2020 0
Most Valuable Participant ,
Sep 14, 2020

Copy link to clipboard

Copied

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
Reply
Loading...
Sep 14, 2020 0
Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

I feel like I am reading ancient sumarian trying to decipher how to do what I need to with those tutorials. I am a low level employee in a ginormous bureaucracy and do not get paid enough to pay for a script. Thank you though for trying to help.

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
Reply
Loading...
Sep 14, 2020 0
Most Valuable Participant ,
Sep 14, 2020

Copy link to clipboard

Copied

If you wish I could set it up for you in this one file for a reduced fee. You can contact me privately via [try6767 at gmail.com] to discuss it further.

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
Reply
Loading...
Sep 14, 2020 0
Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

I live paycheck to paycheck. I'm not paying for this. I came here for help, not to be badgered by a salesman. This is a support community, not a place to drum up business.

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
Reply
Loading...
Sep 14, 2020 0
Most Valuable Participant ,
Sep 14, 2020

Copy link to clipboard

Copied

Sorry, didn't mean to "badger" you...

All the information you need to achieve it is in the links I provided. If you have a specific question about something from there we'll be happy to help you out, but it seems you want us to do your job for you for free, which is not likely to happen.

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
Reply
Loading...
Sep 14, 2020 0
Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

My job isn't to code so no I don't want you to do my job for me for free. I wanted help because I am a glorified secretary asked to create a form. If you already know how it's done, how are you doing my job or any work to just tell me?

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
Reply
Loading...
Sep 14, 2020 0
Adobe Community Professional ,
Sep 14, 2020

Copy link to clipboard

Copied

If you don't want to pay there's plenty of posts in floating around somewhere in this community that certainly have all the answers and scripts that you 're asking about.

 

You just need to put more effort in searching for them.

 

Otherwise, you're basically asking for someone to do all the scripting work for you in which case is a way of outsourcing and should be paid for. In fact , a lot of ungrateful posters come here asking questions similar to your to what appears to be a simple subject, and then they keep adding more complicated subjects to the thread. In the end they didn't even have to lift a finger to even do the leg work.

 

If you noticed the three links that try67 posted for you are the tutorials that you need.

 

You must read a bit through them.

 

Using those three articles  is how I began learning Acrobat JavaScript scripting  in this forum .

So, If you're looking into learning JavaScript and be able to share a little piece of your code I'm pretty sure that a lot of people here would help you.

 

 

 

 

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
Reply
Loading...
Sep 14, 2020 0
Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

Awesome, thank you! I was under the impression that the only things that pertained to my issue were the ones that popped up on the right side after I posted and I couldn't find a close enough answer there. I will do a more comprehensive search now that I know there may be more solutions that better match my issue elsewhere in this community. By the way, this is the only issue that I have and I can adjust it as need be if I just have something to start from (essentially how to add 1 day to a date from another field). Have a great day!

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
Reply
Loading...
Sep 14, 2020 1
Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

So after several hours of trying to figure this all out, instead of trying to understand how to code, I just made the form in Excel. It's not as functional as a PDF, but it will work with a calulation instead of coding. Maybe one day I will learn to code, but something tells me I am not smart enough to figure it out. I barely passed a C++ class 10 years ago.

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
Reply
Loading...
Sep 14, 2020 1
ls_rbls LATEST
Adobe Community Professional ,
Sep 14, 2020

Copy link to clipboard

Copied

Good deal!  Now we're talking.

 

To achieve this with JavaScript  you grab the value of  the date object and convert it to a srtring. 

 

To do this you use two methods (illustrated in full detail in the links posted earlier):

 

  • util.scand()
  • and util.printd()

 

Here's an example that I used in my PDFs from the links that try67 posted for you:

 

//declare your variables; get the date string from date field object
var f  = this.getField("myDateField").value;
var d = util.scand("mm/dd/yyyy", f);  

//add one day to the date string in "myDateField"

d.setDate(d.getDate()+1);  

//display the output of the new date in the desired date format
event.value = util.printd("mm/dd/yyyy", d);

 

You can use this a custom calculation script for each of the  fields you need to pupulate.

 

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
Reply
Loading...
Sep 14, 2020 0