Skip to main content
Level 4
Feb 13, 2025 3:36 PM UTC
Solved

AddMonth function used to aggregate 1 months in AJO helper function

Hi,

 

I am using it:

{%= addMonths(profile._deloittellpcanada.abnMemberDetails.tsExpect_date, 1) %}

simply want to add 1 month to tsExpect_date but action failed because of it.

 

the expect_date format is as 2024-12-04T00:00:00Z. 

 

can you help me out to troubleshoot it?

 

Thank you.

Mohan_Dugganab
Mohan_DugganabAccepted solution
Adobe Employee
Feb 18, 2025 3:26 AM UTC

 


There is a runtime rendering error, kindly log a support ticket for this

9 replies

DavidKangni
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Feb 13, 2025 5:17 PM UTC

@chrisyan 

Try this

Input: {%= addMonths(stringToDate("2024-12-04T00:00:00Z"),1) %}
Validation: {%= addMonths(toDateTimeOnly(profile._deloittellpcanada.abnMemberDetails.tsExpect_date,),1) %}

 

Thanks,

David

Translate
David Kangni
chrisyanAuthor
Level 4
Feb 13, 2025 8:53 PM UTC

no luck here, by the way my date is already defined as datetime with format as 2024-12-04T00:00:00Z why to use ToDatetimeOnly function

Translate
DavidKangni
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Feb 13, 2025 9:49 PM UTC

@chrisyan 

 

I tested again and it's working for me.

by the way my date is already defined as datetime with format as 2024-12-04T00:00:00Z why to use ToDatetimeOnly function? -->

Personalization in AJO is based on the templating syntax called Handlebars. Handlebars.js treats all values as strings by default because it doesn’t have built-in type awareness like JavaScript. This means that even numbers, booleans, or objects will be coerced into strings when rendered in a template. Hence you need to convert it when using helper functions

 

Thanks,

David

Translate
David Kangni