Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

DateTimeField

Avatar

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

Avatar

Correct answer by
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

Avatar

Correct answer by
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