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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Not sure why this isn\'t calculating..


Level 1

Three columns...

In time

Out Time

Total Time (calculate based on in and out entered)

           <field name="hours1" w="18.182mm" h="10.04mm" access="readOnly">



                        <border presence="hidden">

                           <?templateDesigner StyleID aped0?></border>




                  <font typeface="Myriad Pro"/>

                  <margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/>

                  <para vAlign="middle" hAlign="center"/>



                     <corner thickness="0.1778mm"/>



                     <script>if( HasValue(spec1b) &amp; HasValue(spec1a) ) then

// compute time difference in minutes

var TimeDiff = (Time2Num(spec1b.formattedValue, "h:MM A") - Time2Num(spec1a.formattedValue, "h:MM A")) / (1000 * 60)

// truncate to hours

var HourDiff = Floor(TimeDiff / 60)

// get minutes less than 60

var MinDiff = Mod(TimeDiff, 60)

// build fomatted dispaly string

Concat( Format("Z9", HourDiff), ":", Format("99",MinDiff) )


// if any values missing null the output






2 Replies


Level 7

I'm almost ashamed to admit how long it took to figure this one out.

Your outputting the value to a numeric field. Change your field to a text field, and it works just fine.


Level 1

Thank you!

On Mon, May 11, 2015 at 4:41 PM, jasotastic81 <>