Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ConfiForms Form Definition
formNamemyform

d1d1datetrue

d2d2datetrue

d2.timestamp:<[entry.d1.timestamp]Date 2 shall be after the date 1Validation rule

trueINLINE



Dates registered

ConfiForms TableView
formNamemyform

d1

d2



Dates with interval calculated (In TableViewMerger)

ConfiForms TableView Merger

trueid

d1

d2

interval:(([entry.d2.timestamp] - [entry.d1.timestamp])/86400000)

myform



Same calculation using ValueView for each row

ConfiForms ListView
formNamemyform

id:[entry.id]interval:(([entry.d2.timestamp] - [entry.d1.timestamp])/86400000)myform



Expand
titleSource code for the demo
Code Block
<p>In this demo we show how to work with dates and calculate an interval between 2 given dates</p>
<ac:structured-macro ac:macro-id="da3fc550-ce75-47a6-8c08-719c3a763c53" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">myform1</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="d37d4019-4258-423e-a2b3-869dfd592f5b" 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="type">date</ac:parameter>
        <ac:parameter ac:name="required">true</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="4675557b-f3bc-419a-9da7-4fdbd119993a" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">d2</ac:parameter>
        <ac:parameter ac:name="fieldLabel">d2</ac:parameter>
        <ac:parameter ac:name="type">date</ac:parameter>
        <ac:parameter ac:name="required">true</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="de897a81-2ad9-43b5-9963-b9af7ff82d6b" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">d2.timestamp:<[entry.d1.timestamp]</ac:parameter>
        <ac:parameter ac:name="fieldName">Date 2 shall be after the date 1</ac:parameter>
        <ac:parameter ac:name="action">Validation rule</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="8113db66-54be-48cc-a860-b854975f43a1" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="embedded">true</ac:parameter>
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<p>
  <br/>
</p>
<h2>Dates registered</h2>
<ac:structured-macro ac:macro-id="1573f180-b0d8-40b2-ae70-caa2bb6272e6" ac:name="confiform-table" ac:schema-version="1">
  <ac:parameter ac:name="formName">myform1</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="d0d2cbf5-4b8c-423b-aa82-7b2846df6265" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">d1</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="06f0d811-d291-4c84-8c4a-8634f8f1ff61" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">d2</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <br/>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p>
  <br/>
</p>
<h2>Dates with interval calculated (In TableViewMerger)</h2>
<ac:structured-macro ac:macro-id="7294e9e3-2708-482a-b9de-9a8bd12aa94e" ac:name="confiform-table-merger" ac:schema-version="1">
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="d066fb57-10cb-4a4b-9491-6573974c28be" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="hideIfEmpty">true</ac:parameter>
        <ac:parameter ac:name="fieldName">id</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="d8f3e1b5-f723-4e5c-8e34-eada35165616" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">d1</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="1950633a-1deb-4611-8ce8-fade96ee9f23" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">d2</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="12c8e4da-2cf8-4c81-8835-0e984a3f06e3" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">interval:(([entry.d2.timestamp] - [entry.d1.timestamp])/86400000)</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="ee5b80a2-006e-4cae-bec0-8d5f7fa029fd" ac:name="confiform-table" ac:schema-version="1">
      <ac:parameter ac:name="formName">myform1</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<p>
  <br/>
</p>
<h2>Same calculation using ValueView for each row</h2>
<ac:structured-macro ac:macro-id="b3a1f171-b0f2-428d-9a74-4a0a3320b957" ac:name="confiform-list" ac:schema-version="1">
  <ac:parameter ac:name="formName">myform1</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="29960d37-f82b-43f9-93df-a4d024b5f9c1" ac:name="confiform-value" ac:schema-version="1">
        <ac:parameter ac:name="filter">id:[entry.id]</ac:parameter>
        <ac:parameter ac:name="fieldName">interval:(([entry.d2.timestamp] - [entry.d1.timestamp])/86400000)</ac:parameter>
        <ac:parameter ac:name="formName">myform1</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p>
  <br/>
</p>
<p>
  <br/>
</p>
<p>
  <br/>
</p>
<p>
  <br/>
</p>
<p>
  <br/>
</p>
<p>
  <br/>
</p>