Forums

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

Confiforms: DateTime Interval Field

Randy Frennette January 11, 2024 edited

 

First I looked here ConfiForm: How to populate a date interval using definition rules I have it working as answered there. Date field has a rule to copy to Preferred Training Times when not blank. pic1.jpg

1st Question: Can I get rid of the Date Field? Can I create a rule so when first Preferred Training Time [entry.PreferredTrainingTime.startDate] interval field is entered then second interval field [entry.PreferredTrainingTime.endDate] will populate with same date/time?

pic3.jpg

 

2nd Question: If question 1 is feasible how can i adjust rule to add 1 hour to [entry.PreferredTrainingTime.endDate] keeping same date? 

pic2.jpg

2 answers

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Champion
January 15, 2024

Hi @Randy Frennette 

You can do something like this

http://recordit.co/NBsXOw2vLW

Complete storage format for the reference is below

<ac:structured-macro ac:macro-id="d50ee4c1-9ebf-4185-be86-4ecd50a60f65" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="2dd43b13-b6a9-4b1f-b5b9-7f0fa7b596a3" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="b264ad00-5f8a-4fcc-8ffe-0ade1c4ff5c2" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">d</ac:parameter>
<ac:parameter ac:name="fieldLabel">pick time</ac:parameter>
<ac:parameter ac:name="values">30</ac:parameter>
<ac:parameter ac:name="type">datetime</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="98a88878-1a62-4479-9d4a-425db0d6eefa" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">dt</ac:parameter>
<ac:parameter ac:name="fieldLabel">dt</ac:parameter>
<ac:parameter ac:name="values">30</ac:parameter>
<ac:parameter ac:name="type">datetimeinterval</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="6bb391f8-80ec-4522-bfe3-2053668ab7e5" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!d:[empty]</ac:parameter>
<ac:parameter ac:name="values">dt=[entry.d]-[entry.d.add(3600000)]</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">d</ac:parameter>
</ac:structured-macro> <ac:structured-macro ac:macro-id="8312e0fd-ce29-4896-8e46-78a3b5fe21ba" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!d:[empty]</ac:parameter>
<ac:parameter ac:name="fieldName">d</ac:parameter>
<ac:parameter ac:name="action">Hide field</ac:parameter>
<ac:parameter ac:name="actionFieldName">d</ac:parameter>
</ac:structured-macro> <ac:structured-macro ac:macro-id="9ff19efd-da40-460b-939d-3a970f65c9c9" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!d:[empty]</ac:parameter>
<ac:parameter ac:name="fieldName">dt</ac:parameter>
<ac:parameter ac:name="action">Show field</ac:parameter>
<ac:parameter ac:name="actionFieldName">d</ac:parameter>
<ac:parameter ac:name="withReverseRule">true</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>

Alex

Randy Frennette January 15, 2024

Fantastic and so simple, thanks

0 votes
Mykenna Cepek
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2024

You may have better results contacting the App vendor for your answers:

https://marketplace.atlassian.com/apps/1211860/confiforms-data-forms-workflows-for-confluence?hosting=cloud&tab=support

Maybe someone here is familiar with that App and can answer your question. But a lot of the folks here will not be familiar with that particular add-on for Jira (just FYI).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events