I'm creating a timesheet and I'm trying to streamline it to make it easier to fill out. What I need FormCalc to do is calculate the pay period and auto-fill the Dates columns. So all the user will need to do is fill out the begining date of the pay period and then have rest be filled out automatically. Example:
Pay Period Beginning: 2011-06-05 (User Entered) Pay Period Ending: 2011-06-18 (Auto-Fill)
Week 1 | Date | In | Out | In | Out | Hours Worked |
---|---|---|---|---|---|---|
Sunday | 05 (Auto-Fill) | |||||
Monday | 06 (Auto-Fill) | |||||
Tuesday | 07 (Auto-Fill) | |||||
Wednesday | 08 (Auto-Fill) | |||||
Thursday | 09 (Auto-Fill) | |||||
Friday | 10 (Auto-Fill) | |||||
Saturday | 11 (Auto-Fill) |
Week 2 | Date | In | Out | In | Out | Hours Worked |
---|---|---|---|---|---|---|
Sunday | 12 (Auto-Fill) | |||||
Monday | 13 (Auto-Fill) | |||||
Tuesday | 14 (Auto-Fill) | |||||
Wednesday | 15 (Auto-Fill) | |||||
Thursday | 16 (Auto-Fill) | |||||
Friday | 17 (Auto-Fill) | |||||
Saturday | 18 (Auto-Fill) |
I don't even know where to begin with accomplishing this. So any help is greatly appreciated.
Views
Replies
Total Likes
It is simple all you need to do is use Date2Num and Num2Date inbuilt functions.... Here is what I have tried....
I used a table with 7rows and in the 2nd column I used Date/Time Field in each one of those. I named one after another as week1sunday, week1monday....
then except the fist one (week1sunday) rest of the ones I made readOnly. Now in the change event of week1sunday I used the following code to produce the calculating effect....this is FormCalc code
$.parent.parent.Row2.week1monday.rawValue = Num2Date(Date2Num(xfa.event.change,"M/D/YY")+1,"M/D/YY")
$.parent.parent.Row3.week1tuesday.rawValue = Num2Date(Date2Num(xfa.event.change,"M/D/YY")+2,"M/D/YY")
Of course you need to match with your SOM hierarchy but you can use the concepts.
Good luck,
Thank you very much for your answer. But I am also very new to this and was wondering if you could go into more detail. I'm not sure how this will accomplish what I need. What I need is for the Pay Period Begining (Named PPBegin) date to be entered manualy. Then the Pay Period End date to be automatically filled out by adding 14 days to the PPBegin date. Then in the tables I need each cell in the Date column to automatically fill out based on the PPBegin date. What I tried doing before coming here was just putting PPBegin in the Wk1Sun cell and then in the cells below that I put 1+Wk1Sun, 1+Wk1Mon, etc. This would kind of give me what I want except for when I got to the end of the month. So could you break down in detail what this means:
$.parent.parent.Row2.week1monday.rawValue = Num2Date(Date2Num(xfa.event.change,"M/D/YY")+1,"M/D/YY")
I know it may be simple for you but it looks completly greek to me.
Views
Replies
Total Likes