Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Date Issue

Avatar

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
jimb2068
Level 1

05-01-2017

When I enter a date prior to 1930 it shows up as 2000 for example 1929 would be 2029.  How do I fix this?  I have a form where ages are calculated and when a person is born prior to 1930 it will not calculate properly.

Any help is appreciated,

Jim

Accepted Solutions (0)

Answers (9)

Answers (9)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

24-01-2017

Hi Jim,

You would have to set the spilt year in your code, so the age calculation script would be something like ... the bit in bold sets the split year to 20.  This would fix your 01-11-17 with birth date of 01-26-29 problem above.  But if the correct answer to 01-24-17 with birth date of 01-24-16 was 101 then you still have a problem.  Is there a minimum age?

Regards

Bruce

if (HasValue(DOB) and Date2Num(DOB.formattedValue, "MM-DD-YY") > 0) then

    if (HasValue(form1.Page1.subPage1.subEvent.Arrived) and Date2Num(form1.Page1.subPage1.subEvent.Arrived.formattedValue, "MM-DD-YY") > 0) then

        var Arrived_ = Date2Num(form1.Page1.subPage1.subEvent.Arrived.formattedValue, "MM-DD-YY")

        var dobFullYear

        if (Substr(DOB.formattedValue, 7, 2) > 20) then

            dobFullYear = Stuff(DOB.formattedValue, 7, 0, "19")

        else

            dobFullYear = Stuff(DOB.formattedValue, 7, 0, "20")

        endif

        var DOB_ = Date2Num(dobFullYear, "MM-DD-YYYY")

        var diff = Arrived_ - DOB_

        $.rawValue = Floor(diff/365.25)

    else

        $.rawValue = null

    endif

else

    $.rawValue = null

endif

Avatar

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
jimb2068
Level 1

24-01-2017

Hi Bruce,

Thank you for the response.  When I enter the dates you requested I get a result of 1.

How do I set a century split year?

Thanks,

Jim

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

24-01-2017

Hi,

If you are using a two digit year, then you are going to have to set a century split year.  The default, as you have found, is 30.  Anything before 30 is treated as in the 20th century and anything after is treated as the 19th century.

If you enter "01-24-17" as the arrival date and "01-24-16" as the DOB is the age 1 or 101?

Regards

Bruce

Avatar

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
jimb2068
Level 1

18-01-2017

Sorry for all the replies but I'm trying to get this uploaded so you can look at it.  I think docdroid will work so here you go.

<iframe width="800" height="600" src="https://www.docdroid.net/cz3AGMZ/case-report.pdf.html" frameborder="0" allowfullscreen></iframe>

Jim

Avatar

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
jimb2068
Level 1

18-01-2017

Avatar

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
jimb2068
Level 1

11-01-2017

Here is the link to the dropbox file.  If it doesn't work let me know. 

https://www.dropbox.com/s/n8loywwvmmdwnck/Case%20Report.pdf?dl=0https://www.dropbox.com/s/n8loywwvmmdwnck/Case%20Report.pdf?dl=0

Thank you for your help with this.  This was my first attempt at using Livecycle and I am using Livecycle Designer ES4. 

Jim

Avatar

Avatar
Applaud 5
Level 1
geegee734
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile

Avatar
Applaud 5
Level 1
geegee734
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile
geegee734
Level 1

11-01-2017

I think you can upload your form to dropbox, docdroid, wetransfer, etc so it can be viewed (you'd have to link the file). Your date field has a default pattern. The pattern = the way your date is displayed (ie. MMDDYY).

To view this select your 'Date Field' object then make sure you're under the Field tab to then select 'Patterns':Screen Shot 2017-01-11 at 6.00.13 PM.png

Avatar

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
jimb2068
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
jimb2068
Level 1

11-01-2017

Hi Radzmar and thank you for the response.

I used a javascript to format the dates and did not use a pattern.  I need to enter the dates MMDDYY and have it format to MM-DD-YY. I found when I used a FormCalc the dates disappeared from the form when it was saved.  

When I enter the current date and then a birth date to calculate the age and the birth date is before 1930 it gives me a negative number.  For example if I enter 01-11-17 and the birth date of 01-26-29 it gives an age of -13.

It is currently in a text field but gives the same result in a date field.

I can send you the form if need be, but I guess I can't attach an attachment through here.

Jim

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

11-01-2017

I don't see this behavior at my end. How is you date field configured? What patterns do you use?