{"id":1701,"date":"2024-12-23T16:09:45","date_gmt":"2024-12-23T16:09:45","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1701"},"modified":"2025-02-07T09:35:49","modified_gmt":"2025-02-07T09:35:49","slug":"business-days","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/","title":{"rendered":"Business Days Calculator"},"content":{"rendered":"<p><center><div class=\"calculator-container\">\r\n        <h2>Business Days Calculator<\/h2>\r\n        \r\n        <div class=\"input-section\">\r\n            <div class=\"input-group\">\r\n                <label for=\"start-date\">Start Date<\/label>\r\n                <input type=\"date\" id=\"start-date\" required>\r\n                <i class=\"fas fa-calendar input-icon\"><\/i>\r\n            <\/div>\r\n\r\n            <div class=\"input-group\">\r\n                <label for=\"days\">Number of Business Days<\/label>\r\n                <input type=\"number\" id=\"days\" min=\"1\" placeholder=\"Enter number of days\" required>\r\n                <i class=\"fas fa-calculator input-icon\"><\/i>\r\n            <\/div>\r\n\r\n            <div class=\"holiday-toggle\">\r\n                <label for=\"exclude-holidays\">Exclude Holidays<\/label>\r\n                <label class=\"toggle-switch\">\r\n                    <input type=\"checkbox\" id=\"exclude-holidays\">\r\n                    <span class=\"slider\"><\/span>\r\n                <\/label>\r\n                <div class=\"tooltip\">\r\n                    <i class=\"fas fa-info-circle\"><\/i>\r\n                    <span class=\"tooltip-text\">Excludes major US holidays from the calculation<\/span>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"buttons\">\r\n                <button class=\"calculate\" onclick=\"calculateDate()\">\r\n                    <i class=\"fas fa-play\"><\/i>\r\n                    Calculate\r\n                <\/button>\r\n                <button class=\"reset\" onclick=\"resetForm()\">\r\n                    <i class=\"fas fa-redo\"><\/i>\r\n                    Reset\r\n                <\/button>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <div class=\"result-section\">\r\n            <div class=\"result-card\" id=\"result\">\r\n                <div class=\"result-title\">End Date<\/div>\r\n                <div class=\"date-result\" id=\"end-date\"><\/div>\r\n                <div class=\"details\">\r\n                    <div class=\"detail-item\">\r\n                        <div class=\"detail-label\">Calendar Days<\/div>\r\n                        <div class=\"detail-value\" id=\"calendar-days\">-<\/div>\r\n                    <\/div>\r\n                    <div class=\"detail-item\">\r\n                        <div class=\"detail-label\">Weekends Skipped<\/div>\r\n                        <div class=\"detail-value\" id=\"weekends\">-<\/div>\r\n                    <\/div>\r\n                    <div class=\"detail-item\">\r\n                        <div class=\"detail-label\">Holidays Skipped<\/div>\r\n                        <div class=\"detail-value\" id=\"holidays\">-<\/div>\r\n                    <\/div>\r\n                    <div class=\"detail-item\">\r\n                        <div class=\"detail-label\">Total Days<\/div>\r\n                        <div class=\"detail-value\" id=\"total-days\">-<\/div>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        const holidays = {\r\n            \"1\/1\": \"New Year's Day\",\r\n            \"1\/15\": \"Martin Luther King Jr. Day\",\r\n            \"2\/19\": \"Presidents' Day\",\r\n            \"5\/27\": \"Memorial Day\",\r\n            \"6\/19\": \"Juneteenth\",\r\n            \"7\/4\": \"Independence Day\",\r\n            \"9\/2\": \"Labor Day\",\r\n            \"10\/14\": \"Columbus Day\",\r\n            \"11\/11\": \"Veterans Day\",\r\n            \"11\/28\": \"Thanksgiving Day\",\r\n            \"12\/25\": \"Christmas Day\"\r\n        };\r\n\r\n        function isHoliday(date) {\r\n            const monthDay = `${date.getMonth() + 1}\/${date.getDate()}`;\r\n            return holidays[monthDay] !== undefined;\r\n        }\r\n\r\n        function calculateDate() {\r\n            const startDate = document.getElementById('start-date').value;\r\n            const businessDays = parseInt(document.getElementById('days').value);\r\n            const excludeHolidays = document.getElementById('exclude-holidays').checked;\r\n            const resultCard = document.getElementById('result');\r\n\r\n            if (!startDate || !businessDays) {\r\n                alert('Please fill in all fields');\r\n                return;\r\n            }\r\n\r\n            let date = new Date(startDate);\r\n            let daysAdded = 0;\r\n            let weekendsSkipped = 0;\r\n            let holidaysSkipped = 0;\r\n            let calendarDays = 0;\r\n\r\n            while (daysAdded < businessDays) {\r\n                date.setDate(date.getDate() + 1);\r\n                calendarDays++;\r\n                \r\n                const day = date.getDay();\r\n                if (day === 0 || day === 6) {\r\n                    weekendsSkipped++;\r\n                    continue;\r\n                }\r\n\r\n                if (excludeHolidays && isHoliday(date)) {\r\n                    holidaysSkipped++;\r\n                    continue;\r\n                }\r\n\r\n                daysAdded++;\r\n            }\r\n\r\n            document.getElementById('end-date').textContent = formatDate(date);\r\n            document.getElementById('calendar-days').textContent = calendarDays;\r\n            document.getElementById('weekends').textContent = weekendsSkipped;\r\n            document.getElementById('holidays').textContent = holidaysSkipped;\r\n            document.getElementById('total-days').textContent = \r\n                businessDays + weekendsSkipped + (excludeHolidays ? holidaysSkipped : 0);\r\n\r\n            resultCard.classList.add('active');\r\n        }\r\n\r\n        function formatDate(date) {\r\n            return date.toLocaleDateString('en-US', {\r\n                weekday: 'long',\r\n                year: 'numeric',\r\n                month: 'long',\r\n                day: 'numeric'\r\n            });\r\n        }\r\n\r\n        function resetForm() {\r\n            document.getElementById('start-date').value = new Date().toISOString().split('T')[0];\r\n            document.getElementById('days').value = '';\r\n            document.getElementById('exclude-holidays').checked = false;\r\n            const resultCard = document.getElementById('result');\r\n            resultCard.classList.remove('active');\r\n            \r\n            document.getElementById('calendar-days').textContent = '-';\r\n            document.getElementById('weekends').textContent = '-';\r\n            document.getElementById('holidays').textContent = '-';\r\n            document.getElementById('total-days').textContent = '-';\r\n            document.getElementById('end-date').textContent = '';\r\n        }\r\n\r\n        \/\/ Set today as default start date\r\n        document.getElementById('start-date').valueAsDate = new Date();\r\n    <\/script><\/center>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-1701","post","type-post","status-publish","format-standard","hentry","category-time-calculators"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Business Days Calculator - DonHit<\/title>\n<meta name=\"description\" content=\"How Does a Business Days Calculator Work? A business days calculator operates by determining the number of working days between two specified dates.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/donhit.com\/en\/time-calculators\/business-days\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Business Days Calculator - DonHit\" \/>\n<meta property=\"og:description\" content=\"How Does a Business Days Calculator Work? A business days calculator operates by determining the number of working days between two specified dates.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/time-calculators\/business-days\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-23T16:09:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T09:35:49+00:00\" \/>\n<meta name=\"author\" content=\"DonHit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonHit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Business Days Calculator - DonHit","description":"How Does a Business Days Calculator Work? A business days calculator operates by determining the number of working days between two specified dates.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/","og_locale":"en_US","og_type":"article","og_title":"Business Days Calculator - DonHit","og_description":"How Does a Business Days Calculator Work? A business days calculator operates by determining the number of working days between two specified dates.","og_url":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/","og_site_name":"DonHit - World of Tools","article_published_time":"2024-12-23T16:09:45+00:00","article_modified_time":"2025-02-07T09:35:49+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Business Days Calculator","datePublished":"2024-12-23T16:09:45+00:00","dateModified":"2025-02-07T09:35:49+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/"},"wordCount":9,"commentCount":0,"publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"articleSection":["Time Calculators"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/donhit.com\/en\/time-calculators\/business-days\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/","url":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/","name":"Business Days Calculator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2024-12-23T16:09:45+00:00","dateModified":"2025-02-07T09:35:49+00:00","description":"How Does a Business Days Calculator Work? A business days calculator operates by determining the number of working days between two specified dates.","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/time-calculators\/business-days\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/time-calculators\/business-days\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/donhit.com\/en\/"},{"@type":"ListItem","position":2,"name":"Time Calculators","item":"https:\/\/donhit.com\/en\/category\/time-calculators\/"},{"@type":"ListItem","position":3,"name":"Business Days Calculator"}]},{"@type":"WebSite","@id":"https:\/\/donhit.com\/en\/#website","url":"https:\/\/donhit.com\/en\/","name":"DonHit - World of tools","description":"","publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/donhit.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148","name":"DonHit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","contentUrl":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","width":400,"height":267,"caption":"DonHit"},"logo":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/"},"description":"DonHit is a website designed to provide useful tools for everyone. Its primary goal is to support and empower the community. All the tools available on the site are completely free to use.","sameAs":["https:\/\/donhit.com\/en"],"url":"https:\/\/donhit.com\/en\/author\/admin_don\/"}]}},"_links":{"self":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/comments?post=1701"}],"version-history":[{"count":2,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1701\/revisions"}],"predecessor-version":[{"id":2217,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1701\/revisions\/2217"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}