Confiforms: DateTime Interval Field
Asked by Randy Frennette:

First I looked here [ConfiForm: How to populate a date interval using definition rules](https://community.atlassian.com/t5/Confluence-questions/ConfiForm-How-to-populate-a-date-interval-using-definition-rules/qaq-p/1427063?utm_source=dm&utm_medium=unpaid-social&utm_campaign=P:online*O:community*I:social_share*?) I have it working as answered there. Date field has a rule to copy to Preferred Training Times when not blank. ![pic1.jpg](/t5/image/serverpage/image-id/300154iA5DDCDC13464E09B/image-size/large?v=v2&px=999 "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](/t5/image/serverpage/image-id/300158iC6BD2B46E22AB52C/image-size/large?v=v2&px=999 "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](/t5/image/serverpage/image-id/300155i38684026B1AC7435/image-size/large?v=v2&px=999 "pic2.jpg")


Answers:
author: Alex Medved _ConfiForms_
body: Hi [@Randy Frennette](/t5/user/viewprofilepage/user-id/5402710)

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

comments: author: Randy Frennette
body: Fantastic and so simple, thanks


author: Mykenna Cepek
body: 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](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).


Tags: confiforms

confluence-server

server