{"id":1363,"date":"2024-11-24T16:45:49","date_gmt":"2024-11-24T16:45:49","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1363"},"modified":"2025-02-07T09:22:13","modified_gmt":"2025-02-07T09:22:13","slug":"time-card","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/","title":{"rendered":"Time Card Calculator"},"content":{"rendered":"<p><center> <div class=\"container123\">\r\n        <div class=\"header\">\r\n            <h2>Time Card Calculator<\/h2>\r\n            <p>Calculate your work hours and earnings accurately<\/p>\r\n        <\/div>\r\n\r\n        <div class=\"calculator\">\r\n            <div class=\"time-entries\" id=\"timeEntries\">\r\n                <div class=\"entry\">\r\n                    <div class=\"input-group\">\r\n                        <label>Day<\/label>\r\n                        <select>\r\n                            <option>Monday<\/option>\r\n                            <option>Tuesday<\/option>\r\n                            <option>Wednesday<\/option>\r\n                            <option>Thursday<\/option>\r\n                            <option>Friday<\/option>\r\n                            <option>Saturday<\/option>\r\n                            <option>Sunday<\/option>\r\n                        <\/select>\r\n                    <\/div>\r\n                    <div class=\"input-group\">\r\n                        <label>Start Time<\/label>\r\n                        <input type=\"time\" class=\"start-time\">\r\n                    <\/div>\r\n                    <div class=\"input-group\">\r\n                        <label>End Time<\/label>\r\n                        <input type=\"time\" class=\"end-time\">\r\n                    <\/div>\r\n                    <div class=\"input-group\">\r\n                        <label>Break Duration (minutes)<\/label>\r\n                        <input type=\"number\" class=\"break-duration\" value=\"30\" min=\"0\">\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"buttons\">\r\n                <button class=\"btn-primary\" onclick=\"addEntry()\">Add New Entry<\/button>\r\n                <button class=\"btn-primary\" onclick=\"calculateHours()\">Calculate Hours<\/button>\r\n                <button class=\"btn-secondary\" onclick=\"resetCalculator()\">Reset<\/button>\r\n            <\/div>\r\n\r\n            <div class=\"results\">\r\n                <h2>Summary<\/h2>\r\n                <div class=\"result-grid\">\r\n                    <div class=\"result-item\">\r\n                        <h3>Total Hours<\/h3>\r\n                        <p id=\"totalHours\">0.00<\/p>\r\n                    <\/div>\r\n                    <div class=\"result-item\">\r\n                        <h3>Regular Hours<\/h3>\r\n                        <p id=\"regularHours\">0.00<\/p>\r\n                    <\/div>\r\n                    <div class=\"result-item\">\r\n                        <h3>Overtime Hours<\/h3>\r\n                        <p id=\"overtimeHours\">0.00<\/p>\r\n                    <\/div>\r\n                    <div class=\"result-item\">\r\n                        <h3>Total Earnings ($)<\/h3>\r\n                        <p id=\"totalEarnings\">0.00<\/p>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        function addEntry() {\r\n            const timeEntries = document.getElementById('timeEntries');\r\n            const newEntry = timeEntries.children[0].cloneNode(true);\r\n            \r\n            \/\/ Reset input values\r\n            newEntry.querySelectorAll('input').forEach(input => {\r\n                if (input.type === 'time') {\r\n                    input.value = '';\r\n                } else if (input.type === 'number') {\r\n                    input.value = '30';\r\n                }\r\n            });\r\n\r\n            timeEntries.appendChild(newEntry);\r\n        }\r\n\r\n        function calculateHours() {\r\n            const entries = document.getElementsByClassName('entry');\r\n            let totalMinutes = 0;\r\n            let regularHours = 0;\r\n            let overtimeHours = 0;\r\n            \r\n            Array.from(entries).forEach(entry => {\r\n                const startTime = entry.querySelector('.start-time').value;\r\n                const endTime = entry.querySelector('.end-time').value;\r\n                const breakDuration = parseInt(entry.querySelector('.break-duration').value) || 0;\r\n\r\n                if (startTime && endTime) {\r\n                    const start = new Date(`2000\/01\/01 ${startTime}`);\r\n                    let end = new Date(`2000\/01\/01 ${endTime}`);\r\n                    \r\n                    \/\/ Handle cases where end time is on the next day\r\n                    if (end < start) {\r\n                        end = new Date(`2000\/01\/02 ${endTime}`);\r\n                    }\r\n\r\n                    const diffMinutes = (end - start) \/ 1000 \/ 60 - breakDuration;\r\n                    totalMinutes += diffMinutes;\r\n                }\r\n            });\r\n\r\n            const totalHours = totalMinutes \/ 60;\r\n            \r\n            \/\/ Calculate regular and overtime hours\r\n            if (totalHours <= 40) {\r\n                regularHours = totalHours;\r\n            } else {\r\n                regularHours = 40;\r\n                overtimeHours = totalHours - 40;\r\n            }\r\n\r\n            \/\/ Calculate earnings (assuming $15\/hour regular rate and 1.5x for overtime)\r\n            const regularRate = 15;\r\n            const overtimeRate = regularRate * 1.5;\r\n            const totalEarnings = (regularHours * regularRate) + (overtimeHours * overtimeRate);\r\n\r\n            \/\/ Update results\r\n            document.getElementById('totalHours').textContent = totalHours.toFixed(2);\r\n            document.getElementById('regularHours').textContent = regularHours.toFixed(2);\r\n            document.getElementById('overtimeHours').textContent = overtimeHours.toFixed(2);\r\n            document.getElementById('totalEarnings').textContent = totalEarnings.toFixed(2);\r\n        }\r\n\r\n        function resetCalculator() {\r\n            const timeEntries = document.getElementById('timeEntries');\r\n            \/\/ Keep only the first entry and reset its values\r\n            while (timeEntries.children.length > 1) {\r\n                timeEntries.removeChild(timeEntries.lastChild);\r\n            }\r\n\r\n            const firstEntry = timeEntries.children[0];\r\n            firstEntry.querySelectorAll('input').forEach(input => {\r\n                if (input.type === 'time') {\r\n                    input.value = '';\r\n                } else if (input.type === 'number') {\r\n                    input.value = '30';\r\n                }\r\n            });\r\n\r\n            \/\/ Reset results\r\n            document.getElementById('totalHours').textContent = '0.00';\r\n            document.getElementById('regularHours').textContent = '0.00';\r\n            document.getElementById('overtimeHours').textContent = '0.00';\r\n            document.getElementById('totalEarnings').textContent = '0.00';\r\n        }\r\n    <\/script><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"","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-1363","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>Time Card Calculator - DonHit<\/title>\n<meta name=\"description\" content=\"A time card tool automates the process, reducing the burden on both employees and employers. A Simple Guide to Tracking Work Hours\" \/>\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\/time-card\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Time Card Calculator - DonHit\" \/>\n<meta property=\"og:description\" content=\"A time card tool automates the process, reducing the burden on both employees and employers. A Simple Guide to Tracking Work Hours\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/time-calculators\/time-card\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-24T16:45:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T09:22:13+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=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Time Card Calculator - DonHit","description":"A time card tool automates the process, reducing the burden on both employees and employers. A Simple Guide to Tracking Work Hours","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\/time-card\/","og_locale":"en_US","og_type":"article","og_title":"Time Card Calculator - DonHit","og_description":"A time card tool automates the process, reducing the burden on both employees and employers. A Simple Guide to Tracking Work Hours","og_url":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/","og_site_name":"DonHit - World of Tools","article_published_time":"2024-11-24T16:45:49+00:00","article_modified_time":"2025-02-07T09:22:13+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Time Card Calculator","datePublished":"2024-11-24T16:45:49+00:00","dateModified":"2025-02-07T09:22:13+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/"},"wordCount":8,"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\/time-card\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/","url":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/","name":"Time Card Calculator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2024-11-24T16:45:49+00:00","dateModified":"2025-02-07T09:22:13+00:00","description":"A time card tool automates the process, reducing the burden on both employees and employers. A Simple Guide to Tracking Work Hours","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/time-calculators\/time-card\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/time-calculators\/time-card\/#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":"Time Card 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\/1363","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=1363"}],"version-history":[{"count":4,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"predecessor-version":[{"id":2177,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1363\/revisions\/2177"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}