{"id":36,"date":"2026-10-21T17:10:02","date_gmt":"2026-10-21T17:10:02","guid":{"rendered":"https:\/\/ibas2.xyz\/?p=36"},"modified":"2026-10-21T17:10:02","modified_gmt":"2026-10-21T17:10:02","slug":"age-calculator","status":"publish","type":"post","link":"https:\/\/ibas2.xyz\/?p=36","title":{"rendered":"Age Calculator"},"content":{"rendered":"<div id=\"age-calculator\" style=\"max-width: 600px; margin: 20px auto; padding: 25px; border: 1px solid #ddd; border-radius: 16px; box-shadow: 0 4px 18px rgba(0,0,0,.08); font-family: Arial,sans-serif; color: #222; background: #fff; box-sizing: border-box;\">\n<h2 style=\"text-align: center; color: #137547; margin-top: 0;\">\ud83c\udf82 Age Calculator<\/h2>\n<p style=\"text-align: center; color: #666;\">\u0986\u09aa\u09a8\u09be\u09b0 \u09b8\u09a0\u09bf\u0995 \u09ac\u09df\u09b8 \u09b9\u09bf\u09b8\u09be\u09ac \u0995\u09b0\u09c1\u09a8<\/p>\n<p><label style=\"display: block; font-weight: bold; margin: 20px 0 8px;\" for=\"ageBirth\">\u099c\u09a8\u09cd\u09ae\u09a4\u09be\u09b0\u09bf\u0996 \u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8 \u0995\u09b0\u09c1\u09a8<\/label><br \/>\n<input id=\"ageBirth\" style=\"width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; font-size: 16px;\" type=\"date\" \/><\/p>\n<p><label style=\"display: block; font-weight: bold; margin: 18px 0 8px;\" for=\"ageAsOf\">\u09b9\u09bf\u09b8\u09be\u09ac\u09c7\u09b0 \u09a4\u09be\u09b0\u09bf\u0996<\/label><br \/>\n<input id=\"ageAsOf\" style=\"width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; font-size: 16px;\" type=\"date\" \/><\/p>\n<p><button id=\"ageCalculate\" style=\"width: 100%; padding: 14px; margin-top: 20px; background: #137547; color: #fff; border: 0; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer;\" type=\"button\"><br \/>\nCalculate Age \/ \u09ac\u09df\u09b8 \u09b9\u09bf\u09b8\u09be\u09ac \u0995\u09b0\u09c1\u09a8<br \/>\n<\/button><\/p>\n<div id=\"ageResult\" style=\"display: none; margin-top: 20px; padding: 18px; background: #effcf3; border-radius: 10px; text-align: center;\">\n<h3 style=\"margin-top: 0; color: #137547;\">\u0986\u09aa\u09a8\u09be\u09b0 \u09ac\u09df\u09b8<\/h3>\n<div style=\"display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;\">\n<div style=\"background: #fff; padding: 14px; border-radius: 8px; min-width: 75px;\"><strong id=\"ageYears\" style=\"display: block; font-size: 28px; color: #137547;\">0<\/strong>\u09ac\u099b\u09b0<\/div>\n<div style=\"background: #fff; padding: 14px; border-radius: 8px; min-width: 75px;\"><strong id=\"ageMonths\" style=\"display: block; font-size: 28px; color: #137547;\">0<\/strong>\u09ae\u09be\u09b8<\/div>\n<div style=\"background: #fff; padding: 14px; border-radius: 8px; min-width: 75px;\"><strong id=\"ageDays\" style=\"display: block; font-size: 28px; color: #137547;\">0<\/strong>\u09a6\u09bf\u09a8<\/div>\n<\/div>\n<p>\u09ae\u09cb\u099f \u09a6\u09bf\u09a8: <strong id=\"ageTotalDays\"><\/strong><\/p>\n<p>\u09ae\u09cb\u099f \u09b8\u09aa\u09cd\u09a4\u09be\u09b9: <strong id=\"ageWeeks\"><\/strong><\/p>\n<p>\u09aa\u09b0\u09ac\u09b0\u09cd\u09a4\u09c0 \u099c\u09a8\u09cd\u09ae\u09a6\u09bf\u09a8: <strong id=\"ageNextBirthday\"><\/strong><\/p>\n<p>\u099c\u09a8\u09cd\u09ae\u09a6\u09bf\u09a8 \u0986\u09b8\u09a4\u09c7 \u09ac\u09be\u0995\u09bf: <strong id=\"ageRemaining\"><\/strong> \u09a6\u09bf\u09a8<\/p>\n<\/div>\n<\/div>\n<p><script>\n(function(){\n  const root = document.getElementById('age-calculator');\n  if (!root || root.dataset.ready) return;\n  root.dataset.ready = '1';<\/p>\n<p>  const birth = root.querySelector('#ageBirth');\n  const asOf = root.querySelector('#ageAsOf');\n  const error = root.querySelector('#ageError');\n  const result = root.querySelector('#ageResult');<\/p>\n<p>  function dateString(d){\n    return d.getFullYear() + '-' +\n      String(d.getMonth()+1).padStart(2,'0') + '-' +\n      String(d.getDate()).padStart(2,'0');\n  }<\/p>\n<p>  function parseDate(s){\n    if(!s) return null;\n    const p = s.split('-').map(Number);\n    const d = new Date(p[0],p[1]-1,p[2]);\n    return d.getFullYear()===p[0] &&\n      d.getMonth()===p[1]-1 && d.getDate()===p[2] ? d : null;\n  }<\/p>\n<p>  function daysBetween(a,b){\n    return Math.round((Date.UTC(b.getFullYear(),b.getMonth(),b.getDate())-\n      Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()))\/86400000);\n  }<\/p>\n<p>  function birthday(month,day,year){\n    if(month===1 && day===29 &&\n       new Date(year,1,29).getMonth()!==1) return new Date(year,1,28);\n    return new Date(year,month,day);\n  }<\/p>\n<p>  const today = dateString(new Date());\n  asOf.value = today;\n  birth.max = today;<\/p>\n<p>  asOf.addEventListener('change',function(){\n    birth.max = asOf.value || today;\n    result.style.display = 'none';\n  });<\/p>\n<p>  root.querySelector('#ageCalculate').addEventListener('click',function(){\n    error.textContent = '';\n    result.style.display = 'none';<\/p>\n<p>    const b = parseDate(birth.value);\n    const e = parseDate(asOf.value);<\/p>\n<p>    if(!b || !e){\n      error.textContent = '\u099c\u09a8\u09cd\u09ae\u09a4\u09be\u09b0\u09bf\u0996 \u0993 \u09b9\u09bf\u09b8\u09be\u09ac\u09c7\u09b0 \u09a4\u09be\u09b0\u09bf\u0996 \u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8 \u0995\u09b0\u09c1\u09a8\u0964';\n      return;\n    }\n    if(b>e){\n      error.textContent = '\u099c\u09a8\u09cd\u09ae\u09a4\u09be\u09b0\u09bf\u0996 \u09b9\u09bf\u09b8\u09be\u09ac\u09c7\u09b0 \u09a4\u09be\u09b0\u09bf\u0996\u09c7\u09b0 \u09aa\u09b0\u09c7 \u09b9\u09a4\u09c7 \u09aa\u09be\u09b0\u09ac\u09c7 \u09a8\u09be\u0964';\n      return;\n    }<\/p>\n<p>    let y=e.getFullYear()-b.getFullYear();\n    let m=e.getMonth()-b.getMonth();\n    let d=e.getDate()-b.getDate();<\/p>\n<p>    if(d<0){\n      m--;\n      d+=new Date(e.getFullYear(),e.getMonth(),0).getDate();\n    }\n    if(m<0){y--;m+=12;}\n\n    const total=daysBetween(b,e);\n    let ny=e.getFullYear();\n    let next=birthday(b.getMonth(),b.getDate(),ny);\n    if(next<=e){ ny++; next=birthday(b.getMonth(),b.getDate(),ny); } const fmt=n=>n.toLocaleString('en-US');\n    root.querySelector('#ageYears').textContent=fmt(y);\n    root.querySelector('#ageMonths').textContent=fmt(m);\n    root.querySelector('#ageDays').textContent=fmt(d);\n    root.querySelector('#ageTotalDays').textContent=fmt(total);\n    root.querySelector('#ageWeeks').textContent=fmt(Math.floor(total\/7));\n    root.querySelector('#ageNextBirthday').textContent=dateString(next);\n    root.querySelector('#ageRemaining').textContent=fmt(daysBetween(e,next));<\/p>\n<p>    result.style.display='block';\n  });\n})();\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83c\udf82 Age Calculator \u0986\u09aa\u09a8\u09be\u09b0 \u09b8\u09a0\u09bf\u0995 \u09ac\u09df\u09b8 \u09b9\u09bf\u09b8\u09be\u09ac \u0995\u09b0\u09c1\u09a8 \u099c\u09a8\u09cd\u09ae\u09a4\u09be\u09b0\u09bf\u0996 \u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8 \u0995\u09b0\u09c1\u09a8 \u09b9\u09bf\u09b8\u09be\u09ac\u09c7\u09b0 \u09a4\u09be\u09b0\u09bf\u0996 Calculate Age \/ \u09ac\u09df\u09b8 \u09b9\u09bf\u09b8\u09be\u09ac \u0995\u09b0\u09c1\u09a8 \u0986\u09aa\u09a8\u09be\u09b0 \u09ac\u09df\u09b8 0\u09ac\u099b\u09b0 0\u09ae\u09be\u09b8 0\u09a6\u09bf\u09a8\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-36","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ibas2.xyz\/index.php?rest_route=\/wp\/v2\/posts\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibas2.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibas2.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibas2.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibas2.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36"}],"version-history":[{"count":1,"href":"https:\/\/ibas2.xyz\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions"}],"predecessor-version":[{"id":37,"href":"https:\/\/ibas2.xyz\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions\/37"}],"wp:attachment":[{"href":"https:\/\/ibas2.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibas2.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibas2.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}