{"id":384,"date":"2024-12-18T09:45:04","date_gmt":"2024-12-18T09:45:04","guid":{"rendered":"https:\/\/daywork.nl\/?page_id=384"},"modified":"2024-12-18T09:45:04","modified_gmt":"2024-12-18T09:45:04","slug":"berekenen-datums-t-b-v-obm","status":"publish","type":"page","link":"https:\/\/daywork.nl\/index.php\/berekenen-datums-t-b-v-obm\/","title":{"rendered":"Berekenen datums (t.b.v. OBM)"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"nl\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Berekenen datums tool (t.b.v. OBM) <\/title>\n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            margin: 20px;\n        }\n        .tool-container {\n            max-width: 600px;\n            margin: 0 auto;\n            padding: 20px;\n            border: 1px solid #ccc;\n            border-radius: 8px;\n            background: #f9f9f9;\n        }\n        .form-group {\n            margin-bottom: 15px;\n        }\n        label {\n            display: block;\n            margin-bottom: 5px;\n            font-weight: bold;\n        }\n        input, button {\n            width: 100%;\n            padding: 10px;\n            margin-top: 5px;\n            font-size: 16px;\n        }\n        button {\n            background: #007bff;\n            color: white;\n            border: none;\n            cursor: pointer;\n        }\n        button:hover {\n            background: #0056b3;\n        }\n        .result {\n            margin-top: 20px;\n            padding: 10px;\n            background: #e7f3ff;\n            border: 1px solid #007bff;\n            border-radius: 5px;\n            font-size: 16px;\n        }\n        .section {\n            margin-bottom: 40px;\n        }\n        .section h2 {\n            margin-bottom: 20px;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"tool-container\">\n        <h1>Berekenen datums (t.b.v. OBM)<\/h1>\n\n        <!-- Sectie 1: Einddatum berekenen -->\n        <div class=\"section\">\n            <h2>Einddatum Berekenen<\/h2>\n            <div class=\"form-group\">\n                <label for=\"startDate1\">Begindatum<\/label>\n                <input type=\"date\" id=\"startDate1\">\n            <\/div>\n            <div class=\"form-group\">\n                <label for=\"days\">Aantal dagen<\/label>\n                <input type=\"number\" id=\"days\">\n            <\/div>\n            <button onclick=\"calculateEndDate()\">Bereken Einddatum<\/button>\n            <div id=\"resultEndDate\" class=\"result\" style=\"display: none;\"><\/div>\n        <\/div>\n\n        <!-- Sectie 2: Dagen tussen datums berekenen -->\n        <div class=\"section\">\n            <h2>Aantal Dagen Berekenen<\/h2>\n            <div class=\"form-group\">\n                <label for=\"startDate2\">Begindatum<\/label>\n                <input type=\"date\" id=\"startDate2\">\n            <\/div>\n            <div class=\"form-group\">\n                <label for=\"endDate\">Einddatum<\/label>\n                <input type=\"date\" id=\"endDate\">\n            <\/div>\n            <button onclick=\"calculateDaysBetween()\">Bereken Aantal Dagen<\/button>\n            <div id=\"resultDaysBetween\" class=\"result\" style=\"display: none;\"><\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        \/\/ Bereken einddatum\n        function calculateEndDate() {\n            const startDate = new Date(document.getElementById('startDate1').value);\n            const days = parseInt(document.getElementById('days').value);\n\n            if (!startDate || isNaN(days)) {\n                alert('Vul alle velden correct in.');\n                return;\n            }\n\n            const endDate = new Date(startDate);\n            endDate.setDate(startDate.getDate() + days);\n\n            \/\/ Datum in Nederlandse notatie (dd-mm-jjjj)\n            const formattedEndDate = endDate.toLocaleDateString('nl-NL', {\n                day: '2-digit',\n                month: '2-digit',\n                year: 'numeric'\n            });\n\n            document.getElementById('resultEndDate').innerText = `De einddatum is: ${formattedEndDate}`;\n            document.getElementById('resultEndDate').style.display = 'block';\n        }\n\n        \/\/ Bereken aantal dagen tussen datums\n        function calculateDaysBetween() {\n            const startDate = new Date(document.getElementById('startDate2').value);\n            const endDate = new Date(document.getElementById('endDate').value);\n\n            if (!startDate || !endDate) {\n                alert('Vul alle velden correct in.');\n                return;\n            }\n\n            if (startDate > endDate) {\n                alert('De begindatum mag niet na de einddatum liggen.');\n                return;\n            }\n\n            \/\/ Aantal dagen exclusief de eerste dag en inclusief de laatste dag\n            const daysBetween = Math.round((endDate - startDate) \/ (1000 * 60 * 60 * 24));\n\n            document.getElementById('resultDaysBetween').innerText = \n                `Het aantal dagen tussen de datums is: ${daysBetween} dagen (de eerste dag is niet meegeteld, de laatste dag wel).`;\n            document.getElementById('resultDaysBetween').style.display = 'block';\n        }\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Berekenen datums tool (t.b.v. OBM) Berekenen datums (t.b.v. OBM) Einddatum Berekenen Begindatum Aantal dagen Bereken Einddatum Aantal Dagen Berekenen Begindatum Einddatum Bereken Aantal Dagen<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-384","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/pages\/384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/comments?post=384"}],"version-history":[{"count":9,"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/pages\/384\/revisions"}],"predecessor-version":[{"id":393,"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/pages\/384\/revisions\/393"}],"wp:attachment":[{"href":"https:\/\/daywork.nl\/index.php\/wp-json\/wp\/v2\/media?parent=384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}