periodlength

두 날짜 사이의 시간을 계산합니다.

다음 시간 단위 중 하나를 지정해야 합니다.

periodlength 표현식은 기간의 종료 날짜가 inclusive인지 exclusive인지 아니면 종료 날짜인지 여부도 지정해야 합니다(기간은 항상 시작 날짜를 포함함).

기간 길이의 계산은 항상 근사치 정수로 반내림됩니다.

<?xml version="1.0" encoding="UTF-8"?>
<RuleSet name="Example_periodlength"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
"http://www.curamsoftware.com/CreoleRulesSchema.xsd">
  <Class name="PeriodLengthExampleClass">

    <!-- NB 1970년은 윤년이 아님 -->
    <Attribute name="firstDayOfJanuary1970">
      <type>
        <javaclass name="curam.util.type.Date"/>
      </type>
      <derivation>
        <Date value="1970-01-01"/>
      </derivation>
    </Attribute>

    <Attribute name="lastDayOfDecember1970">
      <type>
        <javaclass name="curam.util.type.Date"/>
      </type>
      <derivation>
        <Date value="1970-12-31"/>
      </derivation>
    </Attribute>

    <Attribute name="firstDayOfJanuary1971">
      <type>
        <javaclass name="curam.util.type.Date"/>
      </type>
      <derivation>
        <Date value="1971-01-01"/>
      </derivation>
    </Attribute>

    <Attribute name="sameDay_LengthInDays">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <!-- 동일한 날 = 1일에 시작하고 종료함 -->
        <periodlength endDateInclusion="inclusive" unit="days">
          <reference attribute="firstDayOfJanuary1970"/>
          <reference attribute="firstDayOfJanuary1970"/>
        </periodlength>
      </derivation>
    </Attribute>

    <Attribute name="sameDay_LengthInWeeks">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <!-- 동일한 날 = 0주에 시작하고 종료함-->
        <periodlength endDateInclusion="exclusive" unit="weeks">
          <reference attribute="firstDayOfJanuary1970"/>
          <reference attribute="firstDayOfJanuary1970"/>
        </periodlength>
      </derivation>
    </Attribute>

    <Attribute name="januaryToDecember_LengthInDays">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <!-- 365일 -->
        <periodlength endDateInclusion="inclusive" unit="days">
          <reference attribute="firstDayOfJanuary1970"/>
          <reference attribute="lastDayOfDecember1970"/>
        </periodlength>
      </derivation>
    </Attribute>

    <Attribute name="januaryToDecember_LengthInYearsExclusive">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <!-- 0년(거의 1년이며 단 하루가 모자람) -->
        <periodlength endDateInclusion="exclusive" unit="years">
          <reference attribute="firstDayOfJanuary1970"/>
          <reference attribute="lastDayOfDecember1970"/>
        </periodlength>
      </derivation>
    </Attribute>

    <Attribute name="januaryToDecember_LengthInYearsInclusive">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <!-- 1년(정확히) -->
        <periodlength endDateInclusion="inclusive" unit="years">
          <reference attribute="firstDayOfJanuary1970"/>
          <reference attribute="lastDayOfDecember1970"/>
        </periodlength>
      </derivation>
    </Attribute>


    <Attribute name="januaryToJanuary_LengthInYearsExclusive">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <!-- 1년(정확히) -->
        <periodlength endDateInclusion="exclusive" unit="years">
          <reference attribute="firstDayOfJanuary1970"/>
          <reference attribute="firstDayOfJanuary1971"/>
        </periodlength>
      </derivation>
    </Attribute>

  </Class>

</RuleSet>