{"id":3416,"date":"2024-05-31T10:05:16","date_gmt":"2024-05-31T02:05:16","guid":{"rendered":"https:\/\/0592ban.cn\/?p=3416"},"modified":"2024-05-31T10:05:16","modified_gmt":"2024-05-31T02:05:16","slug":"1968%e5%b9%b411%e6%9c%881%e5%8f%b7%e5%87%ba%e7%94%9f%e7%9a%84%e4%bb%8a%e5%b9%b4%e5%a4%9a%e5%b0%91%e5%b2%81-1968%e5%b9%b411%e6%9c%884%e6%97%a5%e5%86%9c%e5%8e%86%e6%98%af%e5%a4%9a%e5%b0%91","status":"publish","type":"post","link":"https:\/\/0592ban.cn\/index.php\/2024\/05\/31\/1968%e5%b9%b411%e6%9c%881%e5%8f%b7%e5%87%ba%e7%94%9f%e7%9a%84%e4%bb%8a%e5%b9%b4%e5%a4%9a%e5%b0%91%e5%b2%81-1968%e5%b9%b411%e6%9c%884%e6%97%a5%e5%86%9c%e5%8e%86%e6%98%af%e5%a4%9a%e5%b0%91\/","title":{"rendered":"1968\u5e7411\u67081\u53f7\u51fa\u751f\u7684\u4eca\u5e74\u591a\u5c11\u5c81 (1968\u5e7411\u67084\u65e5\u519c\u5386\u662f\u591a\u5c11)"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"1968\u5e7411\u67084\u65e5\u519c\u5386\u662f\u591a\u5c11\" loading=\"lazy\" src=\"https:\/\/0592ban.cn\/wp-content\/uploads\/2024\/05\/798b1ae6-1feb-47ca-9c38-c3dba41ca733.jpg\"\/><\/p>\n<form>\n <label for=\"birthday\"><br \/>\n  \u516c\u5386\u51fa\u751f\u65e5\u671f\uff1a<br \/>\n <\/label><br \/>\n <input id=\"birthday\" name=\"birthday\" type=\"date\"\/><br \/>\n <br \/>\n <input type=\"submit\" value=\"\u8ba1\u7b97\"\/><br \/>\n <br \/>\n<\/form>\n<p><script>\n const form = document.querySelector(\"form\");<\/p>\n<p>    form.addEventListener(\"submit\", (event) => {\n      event.preventDefault();<\/p>\n<p>      const birthday = new Date(document.querySelector(\"birthday\").value);\n      const today = new Date();<\/p>\n<p>      const diffYears = today.getFullYear() - birthday.getFullYear();\n      const diffMonths = today.getMonth() - birthday.getMonth();\n      const diffDays = today.getDate() - birthday.getDate();<\/p>\n<p>      let weekAge = diffYears;\n      if (diffMonths < 0 || (diffMonths === 0 &#038;&#038; diffDays < 0)) {\n        weekAge--;\n      }\n\n      let lunarAge = weekAge + 1;\n\n      const result = `\u5468\u5c81\uff1a${weekAge}<br \/>\u865a\u5c81\uff1a${lunarAge}`;<\/p>\n<p>      document.querySelector(\"result\").innerHTML = result;\n    });\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u516c\u5386\u51fa\u751f\u65e5\u671f\uff0cconstform=document.querySelector\uff0cform\uff0cform.addEventListener\uff0csubmit\uff0cevent\uff0c=\uff0cevent.preventDefault\uff0cconstbirthday=newDate\uff0cdocument.querySelector\uff0cbirthday\uff0c.value&#8230;\u3002<\/p>\n","protected":false},"author":1,"featured_media":3415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1997],"class_list":["post-3416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12shengxiao","tag-1997"],"_links":{"self":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/3416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/comments?post=3416"}],"version-history":[{"count":1,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/3416\/revisions"}],"predecessor-version":[{"id":3417,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/3416\/revisions\/3417"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media\/3415"}],"wp:attachment":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media?parent=3416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/categories?post=3416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/tags?post=3416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}