{"id":2855,"date":"2025-01-10T23:48:04","date_gmt":"2025-01-10T16:48:04","guid":{"rendered":"https:\/\/trannghiait.com\/?page_id=2855"},"modified":"2025-01-11T00:51:45","modified_gmt":"2025-01-10T17:51:45","slug":"he-thong-tinh-tuoi-nghi-huu-online-2025","status":"publish","type":"page","link":"https:\/\/trannghiait.com\/index.php\/phan-mem-tinh-bhxh-1-lan\/he-thong-tinh-tuoi-nghi-huu-online-2025\/","title":{"rendered":"H\u1ec7 th\u1ed1ng t\u00ednh tu\u1ed5i ngh\u1ec9 h\u01b0u online 2025"},"content":{"rendered":"    <div id=\"retirement-calculator\" style=\"max-width: 400px; margin: auto; padding: 20px; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); font-family: Arial, sans-serif;\">\r\n        <h3 style=\"text-align: center; color: #0073aa;\">Retirement Date Calculator<\/h3>\r\n        <form id=\"rac-form\" style=\"margin-top: 20px;\">\r\n            <label for=\"dob\" style=\"display: block; margin-bottom: 10px;\">Enter your date of birth:<\/label>\r\n            <input type=\"date\" id=\"dob\" name=\"dob\" style=\"width: 100%; padding: 10px; margin-bottom: 20px; border: 1px solid #ddd; border-radius: 4px;\" required>\r\n            \r\n            <label for=\"gender\" style=\"display: block; margin-bottom: 10px;\">Select your gender:<\/label>\r\n            <select id=\"gender\" name=\"gender\" style=\"width: 100%; padding: 10px; margin-bottom: 20px; border: 1px solid #ddd; border-radius: 4px;\" required>\r\n                <option value=\"\">-- Select Gender --<\/option>\r\n                <option value=\"male\">Male<\/option>\r\n                <option value=\"female\">Female<\/option>\r\n            <\/select>\r\n\r\n            <button type=\"submit\" style=\"width: 100%; padding: 10px; background-color: #0073aa; color: white; border: none; border-radius: 4px; cursor: pointer;\">Calculate<\/button>\r\n        <\/form>\r\n        <div id=\"rac-result\" style=\"margin-top: 20px; text-align: center; font-weight: bold; color: #333;\"><\/div>\r\n    <\/div>\r\n    <script>\r\n        document.getElementById('rac-form').addEventListener('submit', function(e) {\r\n            e.preventDefault();\r\n            const dob = new Date(document.getElementById('dob').value);\r\n            const gender = document.getElementById('gender').value;\r\n            \r\n            if (!dob || !gender) {\r\n                alert(\"Please fill out both fields.\");\r\n                return;\r\n            }\r\n\r\n            const birthYear = dob.getFullYear();\r\n            const birthMonth = dob.getMonth() + 1; \/\/ Months are 0-indexed\r\n            const birthDate = dob.getDate();\r\n\r\n            let retirementYear, retirementMonth;\r\n\r\n            if (gender === \"male\") {\r\n                \/\/ Nam - t\u00ednh tu\u1ed5i ngh\u1ec9 h\u01b0u theo quy \u0111\u1ecbnh\r\n                if (birthYear < 1961 || (birthYear === 1961 && birthMonth < 5)) {\r\n                    retirementYear = 2021;\r\n                    retirementMonth = 5;\r\n                } else if (birthYear >= 1966 || (birthYear === 1966 && birthMonth >= 4)) {\r\n                    retirementYear = birthYear + 62 - 60;\r\n                    retirementMonth = birthMonth;\r\n                } else {\r\n                    \/\/ T\u00ednh ngh\u1ec9 h\u01b0u t\u1eeb 60 tu\u1ed5i 3 th\u00e1ng, t\u0103ng th\u00eam 3 th\u00e1ng m\u1ed7i n\u0103m\r\n                    const monthsOver = (birthYear - 1961) * 12 + (birthMonth - 1);\r\n                    const extraMonths = Math.floor((monthsOver - 60 * 12) \/ 12) * 3;\r\n                    retirementYear = birthYear + 60 + Math.floor(extraMonths \/ 12);\r\n                    retirementMonth = birthMonth + (extraMonths % 12);\r\n                    if (retirementMonth > 12) {\r\n                        retirementYear++;\r\n                        retirementMonth -= 12;\r\n                    }\r\n                }\r\n            } else {\r\n                \/\/ N\u1eef - t\u00ednh tu\u1ed5i ngh\u1ec9 h\u01b0u theo quy \u0111\u1ecbnh\r\n                if (birthYear < 1961 || (birthYear === 1961 && birthMonth < 6)) {\r\n                    retirementYear = 2021;\r\n                    retirementMonth = 6;\r\n                } else if (birthYear >= 1975 || (birthYear === 1975 && birthMonth >= 5)) {\r\n                    retirementYear = birthYear + 62 - 55;\r\n                    retirementMonth = birthMonth;\r\n                } else {\r\n                    \/\/ T\u00ednh ngh\u1ec9 h\u01b0u t\u1eeb 55 tu\u1ed5i 4 th\u00e1ng, t\u0103ng th\u00eam 4 th\u00e1ng m\u1ed7i n\u0103m\r\n                    const monthsOver = (birthYear - 1961) * 12 + (birthMonth - 1);\r\n                    const extraMonths = Math.floor((monthsOver - 55 * 12) \/ 12) * 4;\r\n                    retirementYear = birthYear + 55 + Math.floor(extraMonths \/ 12);\r\n                    retirementMonth = birthMonth + (extraMonths % 12);\r\n                    if (retirementMonth > 12) {\r\n                        retirementYear++;\r\n                        retirementMonth -= 12;\r\n                    }\r\n                }\r\n            }\r\n\r\n            \/\/ T\u1ea1o ng\u00e0y ngh\u1ec9 h\u01b0u\r\n            const retirementDate = new Date(retirementYear, retirementMonth - 1, birthDate);\r\n            const options = { year: 'numeric', month: 'long', day: 'numeric' };\r\n            const formattedDate = retirementDate.toLocaleDateString('en-GB', options);\r\n\r\n            const resultMessage = `Your retirement date is <strong>${formattedDate}<\/strong>.`;\r\n            document.getElementById('rac-result').innerHTML = resultMessage;\r\n        });\r\n    <\/script>\r\n    \n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><\/div>","protected":false},"author":1,"featured_media":0,"parent":2207,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2855","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/pages\/2855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/comments?post=2855"}],"version-history":[{"count":3,"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/pages\/2855\/revisions"}],"predecessor-version":[{"id":2858,"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/pages\/2855\/revisions\/2858"}],"up":[{"embeddable":true,"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/pages\/2207"}],"wp:attachment":[{"href":"https:\/\/trannghiait.com\/index.php\/wp-json\/wp\/v2\/media?parent=2855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}