Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Unable to reference data in Date/Time object

Avatar

Level 1

I have created a Date/Time object cDate.  Another Date/Time was created IntDate which is bound to cDate and has the paterns set to the following:  Display set to date{D}|date.default{} and Data set to date.default{D}|date.default{}  so that the result gives only the day of the month.  I have been unsucessful in being able to bind the data from IntDate to any other objects.  I have searched to no avail.

What I need is the value of the day of the month in one Date/Time object to be used in a calculation in a Numeric Field calculation using FormCalc.

Any help will ne greatly Appreciated.

Lee

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I modified a sample that I had to show you. Have a look at the code behind the button.

Paul

View solution in original post

4 Replies

Avatar

Former Community Member

You might find it easier to use a Javascript date object instead. If you do that then there is a simple Javascript call to get the day of the month back for that specific date.

Paul    

Avatar

Level 1

Thanks Paul, however my knowledge of Java is about as small as my brain on a Sunday morning.  If you have a lead for the script that I might could plug in, I would appreciate it an d owe you a moon pie and a RC Cola.

Lee

Avatar

Correct answer by
Former Community Member

I modified a sample that I had to show you. Have a look at the code behind the button.

Paul

Avatar

Level 1

Thank you.  I will take a look at it later today.

Lee

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----