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

SOLVED

DateTimeField

ra_be
Level 2
Level 2
Dear all,

I am working with LiveCycle Designer ES 8.2 (German version).

I have a form with a datetimefield (the value can be changed by the user). The date is shown like  "date{D.MM.YY}"and it must be like this. The display cannot be changed to "date{WW}" and thus "this.formattedValue" will not work out.

But I need the week number ("date{WW}") of the entered date of the datetimefield for further calculation.

Does anybody have an idea how to get the week number out of a datetimefield with Javascript?

Many hanks.

Regards,
ra_be

1 Accepted Solution
_Bruce_Robertson
Correct answer by
Level 10
Level 10

Hi ra_be,

You can use the same XFA picture clauses in the util.printd method. Both util.printd() and util.scand() are part of the Acrobat JavaScript and are described in the "Acrobat JavaScript Scripting Reference".  A bit confusing because that use different picture clauses, e.g. "MM" in XFA is a zero padded month but in printd is the zero padded minutes.

Anyway try something like;

util.printd(

"date(de_DE){WW}", util.scand("d.mm.yy", DateTimeField1.formattedValue), true)

Where "date(de_DE){WW}" is the output format using the german locale and "d.mm.yy" is the Acrobat version of your XFA formatted date field.

Bruce

View solution in original post

1 Reply
_Bruce_Robertson
Correct answer by
Level 10
Level 10

Hi ra_be,

You can use the same XFA picture clauses in the util.printd method. Both util.printd() and util.scand() are part of the Acrobat JavaScript and are described in the "Acrobat JavaScript Scripting Reference".  A bit confusing because that use different picture clauses, e.g. "MM" in XFA is a zero padded month but in printd is the zero padded minutes.

Anyway try something like;

util.printd(

"date(de_DE){WW}", util.scand("d.mm.yy", DateTimeField1.formattedValue), true)

Where "date(de_DE){WW}" is the output format using the german locale and "d.mm.yy" is the Acrobat version of your XFA formatted date field.

Bruce

View solution in original post