Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set date for date time interval field

Ryan Kafoor
Contributor
March 15, 2024

Hello,

 

I am trying to set a calculated date value for endDate value when a startDate is selected in a date interval field. However, nothing seems to work for me so far. What am I doing here wrong?

<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="ddfa8bbd-a3e8-41a3-8df2-049cefe28d71" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f1</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="32c99bb3-be63-434c-8fd7-52b5055473a9" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="embedded">true</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="e9731b20-7392-4144-a533-494ef23686d7" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">d1</ac:parameter>
<ac:parameter ac:name="fieldLabel">d1</ac:parameter>
<ac:parameter ac:name="values">0</ac:parameter>
<ac:parameter ac:name="extras">dd.MM.yyyy</ac:parameter>
<ac:parameter ac:name="type">datetimeinterval</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="301e891c-1be9-46fb-921b-3e61066f4c65" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!d1.startDate:[empty]</ac:parameter>
<ac:parameter ac:name="values">d1.endDare=([entry.d1.startDate.timestamp] +1296000000)</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">d1.startDate</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>

 

1 answer

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Champion
March 15, 2024 edited
Ryan Kafoor
Contributor
March 15, 2024

Thanks alex. But is there a way to reference just the startDate and then use it to fill the endDate of the date interval field without using an additional date field.  Something like this. 

dateInterval = [entry.dateInterval.startDate]-[entry.dateInterval.startDate.add(3600000)]

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events