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

building a timesheet.

New Here ,
Jul 26, 2020 Jul 26, 2020

Copy link to clipboard

Copied

I have built a timesheet for my employees but unfortunately it confuses some. I need it so you insert the date for the last day of the week and then it automatically fills in the dates next to the corresponding day. For example. 

11/02/2020 Wednesday. 

Please help

TOPICS
Acrobat SDK and JavaScript

Views

276

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 ,
Jul 27, 2020 Jul 27, 2020

Copy link to clipboard

Copied

LATEST

Is that mm/dd/yyyy or dd/mm/yyyy? Either way, it's not a Wednesday...

Anyway, you can do it by creating two fields. Let's say the are called Date1 and Day1. As the custom calculation script of the latter enter the following code:

var s1 = this.getField("Date1").valueAsString;
if (s1=="") event.value = "";
else {
	var d1 = util.scand("dd/mm/yyyy", s1);
	event.value = util.printd("dddd", d1);
}

 

Make sure to adjust the first date format string to match the one you're using in Date1, of course...

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