틀:Age: 두 판 사이의 차이

S.T.E.L.L.A.-WIKI
(새 문서: {{#ifeq:{{PAGESIZE:{{{1}}}}} | 0 | <!-- Check if parameter 1 is empty --> Please provide a date of birth in the format DD.MM.YYYY. | <!-- If not empty, calculate the age --> {{#time: Y | {{CURRENTTIMESTAMP}}}} <!-- Get the current year --> {{#expr: {{#time: Y | {{CURRENTTIMESTAMP}}}} - {{#time: Y | {{{1}}}}} - ({{#time: n | {{CURRENTTIMESTAMP}}}} < {{#time: n | {{{1}}}}} || ({{#time: n | {{CURRENTTIMESTAMP}}}} = {{#time: n | {{{1}}}}} && {{#time: j | {{CURRENTTIMESTAM...)
 
편집 요약 없음
1번째 줄: 1번째 줄:
{{#ifeq:{{PAGESIZE:{{{1}}}}} | 0 | <!-- Check if parameter 1 is empty -->
{{#ifexpr: {{#time:Ymd | {{CURRENTTIMESTAMP}}}} < {{#time:Ymd | {{{1}}}}} | <!-- Check if current date is before birthday this year -->
  Please provide a date of birth in the format DD.MM.YYYY.
   {{#expr: {{#time:Y | {{CURRENTTIMESTAMP}}}} - {{#time:Y | {{{1}}}}} - 1}} <!-- If current date is before birthday, subtract 1 from the age -->
| <!-- If not empty, calculate the age -->
  | <!-- If current date is after birthday this year -->
  {{#time: Y | {{CURRENTTIMESTAMP}}}} <!-- Get the current year -->
  {{#expr: {{#time:Y | {{CURRENTTIMESTAMP}}}} - {{#time:Y | {{{1}}}}}}} <!-- If current date is after birthday, calculate age normally -->
   {{#expr: {{#time: Y | {{CURRENTTIMESTAMP}}}} - {{#time: Y | {{{1}}}}} -  
}}
    ({{#time: n | {{CURRENTTIMESTAMP}}}} < {{#time: n | {{{1}}}}} || ({{#time: n | {{CURRENTTIMESTAMP}}}} = {{#time: n | {{{1}}}}} && {{#time: j | {{CURRENTTIMESTAMP}}}} < {{#time: j | {{{1}}}}}))) }}
<!-- Calculate the age based on the provided date of birth -->

2023년 12월 28일 (목) 13:49 판

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