틀:Age: 두 판 사이의 차이

S.T.E.L.L.A.-WIKI
편집 요약 없음
편집 요약 없음
 
(같은 사용자의 중간 판 6개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{#ifexpr: {{#time:Ymd | {{CURRENTTIMESTAMP}}}} < {{#time:Ymd | {{{1}}}}} | <!-- Check if current date is before birthday this year -->
{{#expr:
  {{#expr: {{#time:Y | {{CURRENTTIMESTAMP}}}} - {{#time:Y | {{{1}}}}} - 1}} <!-- If current date is before birthday, subtract 1 from the age -->
    {{#time:Y | {{CURRENTTIMESTAMP}}}} - {{#time:Y | {{{1}}}}}
  | <!-- If current date is after birthday this year -->
    - {{#ifexpr: {{#time:m | {{CURRENTTIMESTAMP}}}} < {{#time:m | {{{1}}}}}
  {{#expr: {{#time:Y | {{CURRENTTIMESTAMP}}}} - {{#time:Y | {{{1}}}}}}} <!-- If current date is after birthday, calculate age normally -->
        | 1
        | {{#ifexpr: {{#time:m | {{CURRENTTIMESTAMP}}}} > {{#time:m | {{{1}}}}}
            | 0
            | {{#ifexpr: {{#time:d | {{CURRENTTIMESTAMP}}}} < {{#time:d | {{{1}}}}}
                | 1
                | 0
            }}
        }}
    }}
}}
}}

2023년 12월 28일 (목) 14:04 기준 최신판

수식 오류: 예상치 못한 < 연산자입니다.