{"id":27,"date":"2026-11-30T15:41:11","date_gmt":"2026-11-30T15:41:11","guid":{"rendered":"https:\/\/busywork.day\/?page_id=27"},"modified":"2026-12-02T07:40:11","modified_gmt":"2026-12-02T07:40:11","slug":"timesheet","status":"publish","type":"page","link":"https:\/\/busywork.day\/index.php\/timesheet\/","title":{"rendered":"Time Sheet"},"content":{"rendered":"<p>I like building websites, particularly designing and installing widgets and plugins. Both the Time Sheet and Invoice apps can be uploaded to your own WordPress site. You can use here for free and download a PDF copy with your logo. The plugin files are downloadable from <span style=\"text-decoration: underline;\"><span style=\"color: #fc0000;\"><a style=\"color: #fc0000;\" href=\"http:\/\/beinggs.com\"><strong>beinggs Technology<\/strong><\/a><\/span><\/span>.<\/p>\n<!-- Timesheet Studio front-end template. Use [timesheet_studio] in a WordPress Shortcode block. -->\n<div id=\"timesheet-studio-shortcode-default\" class=\"ts-app\" data-ts-instance=\"shortcode-default\" style=\"--ts-accent:#b4b4b4;--ts-ink:#000000;--ts-paper:#ffffff;--ts-panel:#f5f5e6;--ts-border:#bebebe;--ts-font:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, sans-serif;--ts-radius:18px;--ts-field-radius:10px\">\n  <style>\n    .ts-app {\n      --ts-accent: #176b50;\n      --ts-ink: #18231f;\n      --ts-paper: #ffffff;\n      --ts-panel: #f2f7f3;\n      --ts-border: #e3e9e5;\n      --ts-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n      --ts-radius: 18px;\n      --ts-field-radius: 10px;\n      box-sizing: border-box;\n      max-width: 1120px;\n      margin: 28px auto;\n      color: var(--ts-ink);\n      font-family: var(--ts-font);\n      font-size: 14px;\n      line-height: 1.5;\n    }\n\n    .ts-app *,\n    .ts-app *::before,\n    .ts-app *::after {\n      box-sizing: border-box;\n    }\n\n    .ts-app [hidden] {\n      display: none !important;\n    }\n\n    .ts-app button,\n    .ts-app input,\n    .ts-app select {\n      font: inherit;\n    }\n\n    .ts-app button {\n      cursor: pointer;\n    }\n\n    .ts-shell {\n      overflow: hidden;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-radius);\n      background: var(--ts-paper);\n      box-shadow: 0 18px 55px rgba(26, 54, 40, 0.09);\n    }\n\n    .ts-toolbar {\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      gap: 16px;\n      padding: 19px 24px;\n      border-bottom: 1px solid var(--ts-border);\n      background: var(--ts-panel);\n    }\n\n    .ts-brand {\n      display: flex;\n      min-width: 0;\n      align-items: center;\n      gap: 12px;\n    }\n\n    .ts-brand-mark {\n      display: grid;\n      width: 40px;\n      height: 40px;\n      flex: 0 0 auto;\n      place-items: center;\n      border-radius: 13px;\n      background: var(--ts-accent);\n      color: #fff;\n      font-size: 13px;\n      font-weight: 800;\n      letter-spacing: 0.04em;\n    }\n\n    .ts-brand-copy strong {\n      display: block;\n      font-size: 16px;\n      letter-spacing: -0.02em;\n    }\n\n    .ts-brand-copy span,\n    .ts-save-status {\n      color: color-mix(in srgb, var(--ts-ink) 62%, transparent);\n      font-size: 12px;\n    }\n\n    .ts-toolbar-actions,\n    .ts-period-toggle,\n    .ts-period-nav,\n    .ts-logo-row,\n    .ts-weekend-option {\n      display: flex;\n      align-items: center;\n      gap: 9px;\n    }\n\n    .ts-toolbar-actions {\n      flex-wrap: wrap;\n      justify-content: flex-end;\n    }\n\n    .ts-button {\n      display: inline-flex;\n      min-height: 40px;\n      align-items: center;\n      justify-content: center;\n      gap: 7px;\n      padding: 9px 14px;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-field-radius);\n      background: var(--ts-paper);\n      color: var(--ts-ink);\n      font-weight: 650;\n      transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;\n    }\n\n    .ts-button:hover {\n      transform: translateY(-1px);\n      border-color: color-mix(in srgb, var(--ts-accent) 35%, var(--ts-border));\n      background: var(--ts-panel);\n    }\n\n    .ts-button-primary {\n      border-color: var(--ts-accent);\n      background: var(--ts-accent);\n      color: #fff;\n    }\n\n    .ts-button-primary:hover {\n      border-color: var(--ts-accent);\n      background: var(--ts-accent);\n      filter: brightness(0.92);\n    }\n\n    .ts-button-small {\n      min-height: 34px;\n      padding: 6px 10px;\n      font-size: 12px;\n    }\n\n    .ts-content {\n      padding: 26px;\n    }\n\n    .ts-profile-grid {\n      display: grid;\n      grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr);\n      gap: 18px;\n      margin-bottom: 22px;\n    }\n\n    .ts-field label,\n    .ts-field-label {\n      display: block;\n      margin-bottom: 7px;\n      color: var(--ts-ink);\n      font-size: 12px;\n      font-weight: 700;\n    }\n\n    .ts-field input[type=\"text\"],\n    .ts-period-input,\n    .ts-hours-input {\n      width: 100%;\n      min-height: 42px;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-field-radius);\n      background: var(--ts-paper);\n      color: var(--ts-ink);\n      outline: none;\n    }\n\n    .ts-field input[type=\"text\"] {\n      padding: 9px 12px;\n    }\n\n    .ts-app input:focus-visible,\n    .ts-app button:focus-visible {\n      outline: 3px solid color-mix(in srgb, var(--ts-accent) 28%, transparent);\n      outline-offset: 2px;\n    }\n\n    .ts-logo-row {\n      min-height: 42px;\n      flex-wrap: wrap;\n    }\n\n    .ts-logo-file {\n      width: min(100%, 300px);\n      min-height: 42px;\n      padding: 7px;\n      border: 1px dashed var(--ts-border);\n      border-radius: var(--ts-field-radius);\n      background: var(--ts-panel);\n      color: var(--ts-ink);\n      font-size: 12px;\n    }\n\n    .ts-logo-preview {\n      width: 48px;\n      height: 42px;\n      object-fit: contain;\n      padding: 3px;\n      border: 1px solid var(--ts-border);\n      border-radius: 7px;\n      background: #fff;\n    }\n\n    .ts-controls {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: center;\n      justify-content: space-between;\n      gap: 14px;\n      padding: 14px;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-radius);\n      background: var(--ts-panel);\n    }\n\n    .ts-period-toggle {\n      padding: 4px;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-field-radius);\n      background: var(--ts-paper);\n    }\n\n    .ts-period-toggle button {\n      min-height: 34px;\n      padding: 6px 12px;\n      border: 0;\n      border-radius: calc(var(--ts-field-radius) - 3px);\n      background: transparent;\n      color: var(--ts-ink);\n      font-size: 13px;\n      font-weight: 650;\n    }\n\n    .ts-period-toggle button[aria-pressed=\"true\"] {\n      background: var(--ts-accent);\n      color: #fff;\n    }\n\n    .ts-period-nav {\n      flex: 1 1 250px;\n      justify-content: center;\n    }\n\n    .ts-nav-button {\n      width: 38px;\n      min-height: 38px;\n      padding: 0;\n      font-size: 18px;\n    }\n\n    .ts-period-input {\n      width: 190px;\n      padding: 8px 10px;\n      text-align: center;\n    }\n\n    .ts-period-input[type=\"month\"] {\n      width: 175px;\n    }\n\n    .ts-weekend-option {\n      min-height: 40px;\n      color: var(--ts-ink);\n      font-size: 13px;\n      font-weight: 600;\n      white-space: nowrap;\n    }\n\n    .ts-weekend-option input {\n      width: 17px;\n      height: 17px;\n      accent-color: var(--ts-accent);\n    }\n\n    .ts-period-caption {\n      margin: 17px 0 11px;\n      color: color-mix(in srgb, var(--ts-ink) 66%, transparent);\n      font-size: 13px;\n      font-weight: 600;\n    }\n\n    .ts-table-wrap {\n      max-height: 530px;\n      overflow: auto;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-field-radius);\n    }\n\n    .ts-entry-table {\n      width: 100%;\n      border-collapse: collapse;\n      background: var(--ts-paper);\n    }\n\n    .ts-entry-table th {\n      position: sticky;\n      top: 0;\n      z-index: 1;\n      padding: 11px 14px;\n      background: var(--ts-panel);\n      color: var(--ts-ink);\n      font-size: 11px;\n      font-weight: 750;\n      letter-spacing: 0.06em;\n      text-align: left;\n      text-transform: uppercase;\n    }\n\n    .ts-entry-table td {\n      padding: 9px 14px;\n      border-top: 1px solid var(--ts-border);\n      color: var(--ts-ink);\n      vertical-align: middle;\n    }\n\n    .ts-entry-table tbody tr:hover {\n      background: color-mix(in srgb, var(--ts-panel) 58%, var(--ts-paper));\n    }\n\n    .ts-date-cell {\n      width: 38%;\n      font-weight: 650;\n    }\n\n    .ts-day-cell {\n      width: 27%;\n      color: color-mix(in srgb, var(--ts-ink) 62%, transparent) !important;\n    }\n\n    .ts-hours-cell {\n      width: 35%;\n      max-width: 180px;\n    }\n\n    .ts-hours-input {\n      max-width: 150px;\n      min-height: 38px;\n      padding: 7px 10px;\n      text-align: right;\n    }\n\n    .ts-total-row {\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      gap: 14px;\n      margin-top: 16px;\n      padding: 16px 18px;\n      border-radius: var(--ts-field-radius);\n      background: var(--ts-panel);\n    }\n\n    .ts-total-label {\n      color: var(--ts-ink);\n      font-size: 14px;\n      font-weight: 700;\n    }\n\n    .ts-total-value {\n      color: var(--ts-accent);\n      font-size: 24px;\n      font-weight: 800;\n      letter-spacing: -0.04em;\n      white-space: nowrap;\n    }\n\n    .ts-total-unit {\n      margin-left: 5px;\n      color: color-mix(in srgb, var(--ts-ink) 62%, transparent);\n      font-size: 13px;\n      font-weight: 600;\n    }\n\n    .ts-helper {\n      margin: 11px 0 0;\n      color: color-mix(in srgb, var(--ts-ink) 58%, transparent);\n      font-size: 12px;\n    }\n\n    .ts-modal-backdrop {\n      position: fixed;\n      z-index: 999999;\n      inset: 0;\n      display: grid;\n      overflow-y: auto;\n      place-items: center;\n      padding: 24px;\n      background: rgba(14, 28, 21, 0.62);\n    }\n\n    .ts-modal-panel {\n      width: min(760px, 100%);\n      max-height: calc(100vh - 48px);\n      overflow: auto;\n      padding: 22px;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-radius);\n      background: var(--ts-paper);\n      box-shadow: 0 24px 90px rgba(0, 0, 0, 0.24);\n    }\n\n    .ts-modal-header,\n    .ts-modal-actions {\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      gap: 12px;\n    }\n\n    .ts-modal-header {\n      margin-bottom: 16px;\n    }\n\n    .ts-modal-header h3 {\n      margin: 0;\n      color: var(--ts-ink);\n      font-size: 20px;\n      letter-spacing: -0.03em;\n    }\n\n    .ts-close-button {\n      width: 38px;\n      min-height: 38px;\n      padding: 0;\n      font-size: 20px;\n    }\n\n    .ts-preview-sheet {\n      padding: 28px;\n      border: 1px solid var(--ts-border);\n      border-radius: var(--ts-field-radius);\n      background: #fff;\n      color: #18231f;\n    }\n\n    .ts-preview-heading {\n      display: flex;\n      align-items: flex-start;\n      justify-content: space-between;\n      gap: 20px;\n      padding-bottom: 20px;\n      border-bottom: 2px solid var(--ts-accent);\n    }\n\n    .ts-preview-heading h2 {\n      margin: 0 0 5px;\n      color: #18231f;\n      font-size: 30px;\n      letter-spacing: -0.04em;\n    }\n\n    .ts-preview-heading p,\n    .ts-preview-meta p {\n      margin: 0;\n      color: #65736c;\n      font-size: 13px;\n    }\n\n    .ts-preview-logo {\n      max-width: 130px;\n      max-height: 70px;\n      object-fit: contain;\n    }\n\n    .ts-preview-meta {\n      display: flex;\n      justify-content: space-between;\n      gap: 16px;\n      padding: 18px 0;\n    }\n\n    .ts-preview-meta strong {\n      display: block;\n      margin-bottom: 4px;\n      color: #18231f;\n      font-size: 11px;\n      letter-spacing: 0.06em;\n      text-transform: uppercase;\n    }\n\n    .ts-preview-table {\n      width: 100%;\n      border-collapse: collapse;\n      color: #18231f;\n    }\n\n    .ts-preview-table th {\n      padding: 10px;\n      background: #f2f7f3;\n      color: #18231f;\n      font-size: 11px;\n      letter-spacing: 0.06em;\n      text-align: left;\n      text-transform: uppercase;\n    }\n\n    .ts-preview-table td {\n      padding: 9px 10px;\n      border-bottom: 1px solid #e3e9e5;\n      font-size: 13px;\n    }\n\n    .ts-preview-table td:last-child,\n    .ts-preview-table th:last-child {\n      text-align: right;\n    }\n\n    .ts-preview-total {\n      display: flex;\n      justify-content: flex-end;\n      gap: 22px;\n      margin-top: 18px;\n      color: #18231f;\n      font-size: 17px;\n      font-weight: 750;\n    }\n\n    .ts-modal-actions {\n      justify-content: flex-end;\n      margin-top: 18px;\n    }\n\n    .ts-sr-only {\n      position: absolute;\n      width: 1px;\n      height: 1px;\n      overflow: hidden;\n      clip: rect(0, 0, 0, 0);\n      white-space: nowrap;\n      clip-path: inset(50%);\n    }\n\n    @media (max-width: 700px) {\n      .ts-toolbar {\n        align-items: flex-start;\n        flex-direction: column;\n        padding: 16px;\n      }\n\n      .ts-toolbar-actions {\n        width: 100%;\n        justify-content: space-between;\n      }\n\n      .ts-content {\n        padding: 16px;\n      }\n\n      .ts-profile-grid {\n        grid-template-columns: 1fr;\n        gap: 14px;\n      }\n\n      .ts-controls {\n        align-items: stretch;\n        flex-direction: column;\n      }\n\n      .ts-period-toggle {\n        align-self: flex-start;\n      }\n\n      .ts-period-nav {\n        flex: none;\n        justify-content: space-between;\n      }\n\n      .ts-period-input,\n      .ts-period-input[type=\"month\"] {\n        width: min(100%, 230px);\n      }\n\n      .ts-weekend-option {\n        align-self: flex-start;\n      }\n\n      .ts-entry-table th,\n      .ts-entry-table td {\n        padding: 9px 8px;\n      }\n\n      .ts-date-cell {\n        width: 46%;\n      }\n\n      .ts-day-cell {\n        width: 23%;\n      }\n\n      .ts-hours-cell {\n        width: 31%;\n      }\n\n      .ts-hours-input {\n        max-width: 100%;\n      }\n\n      .ts-modal-backdrop {\n        padding: 10px;\n      }\n\n      .ts-modal-panel {\n        max-height: calc(100vh - 20px);\n        padding: 14px;\n      }\n\n      .ts-preview-sheet {\n        padding: 16px;\n      }\n    }\n\n    @media print {\n      @page {\n        margin: 16mm;\n      }\n\n      body.ts-printing > * {\n        display: none !important;\n      }\n\n      body.ts-printing > .ts-app.ts-printing {\n        display: block !important;\n        max-width: none !important;\n        margin: 0 !important;\n        color: #18231f !important;\n        font-family: Arial, sans-serif !important;\n      }\n\n      .ts-app.ts-printing .ts-shell {\n        display: none !important;\n      }\n\n      .ts-app.ts-printing .ts-modal-backdrop {\n        position: static !important;\n        display: block !important;\n        overflow: visible !important;\n        padding: 0 !important;\n        background: #fff !important;\n      }\n\n      .ts-app.ts-printing .ts-modal-panel {\n        width: 100% !important;\n        max-height: none !important;\n        overflow: visible !important;\n        padding: 0 !important;\n        border: 0 !important;\n        border-radius: 0 !important;\n        box-shadow: none !important;\n      }\n\n      .ts-app.ts-printing .ts-modal-header,\n      .ts-app.ts-printing .ts-modal-actions {\n        display: none !important;\n      }\n\n      .ts-app.ts-printing .ts-preview-sheet {\n        display: block !important;\n        padding: 0 !important;\n        border: 0 !important;\n        border-radius: 0 !important;\n      }\n    }\n  <\/style>\n\n  <div class=\"ts-shell\">\n    <header class=\"ts-toolbar\">\n      <div class=\"ts-brand\">\n        <div class=\"ts-brand-mark\" aria-hidden=\"true\">TS<\/div>\n        <div class=\"ts-brand-copy\">\n          <strong>Timesheet<\/strong>\n          <span>Hours saved in this browser<\/span>\n        <\/div>\n      <\/div>\n      <div class=\"ts-toolbar-actions\">\n        <span class=\"ts-save-status\" data-field=\"save-status\" aria-live=\"polite\">Saved in this browser<\/span>\n        <button class=\"ts-button ts-button-primary\" type=\"button\" data-action=\"preview\">Preview timesheet<\/button>\n      <\/div>\n    <\/header>\n\n    <main class=\"ts-content\">\n      <section class=\"ts-profile-grid\" aria-label=\"Timesheet details\">\n        <div class=\"ts-field\">\n          <label for=\"ts-employee-name\">Employee name<\/label>\n          <input id=\"ts-employee-name\" data-field=\"employee-name\" type=\"text\" autocomplete=\"name\" placeholder=\"Enter employee name\">\n        <\/div>\n        <div class=\"ts-field\">\n          <span class=\"ts-field-label\">Company or employee logo<\/span>\n          <div class=\"ts-logo-row\">\n            <img class=\"ts-logo-preview\" data-field=\"logo-preview\" alt=\"Uploaded logo preview\" hidden>\n            <input class=\"ts-logo-file\" data-field=\"logo-file\" type=\"file\" accept=\"image\/png,image\/jpeg,image\/webp\" aria-label=\"Upload a logo\">\n            <button class=\"ts-button ts-button-small\" type=\"button\" data-action=\"remove-logo\" hidden>Remove logo<\/button>\n          <\/div>\n        <\/div>\n      <\/section>\n\n      <section class=\"ts-controls\" aria-label=\"Timesheet period options\">\n        <div class=\"ts-period-toggle\" role=\"group\" aria-label=\"Timesheet period\">\n          <button type=\"button\" data-mode=\"week\" aria-pressed=\"true\">Weekly<\/button>\n          <button type=\"button\" data-mode=\"month\" aria-pressed=\"false\">Monthly<\/button>\n        <\/div>\n        <div class=\"ts-period-nav\">\n          <button class=\"ts-button ts-nav-button\" type=\"button\" data-action=\"previous-period\" aria-label=\"Previous period\">\u2039<\/button>\n          <label>\n            <span class=\"ts-sr-only\" data-field=\"period-input-label\">Choose week<\/span>\n            <input class=\"ts-period-input\" data-field=\"period-input\" type=\"date\" aria-label=\"Choose week\">\n          <\/label>\n          <button class=\"ts-button ts-nav-button\" type=\"button\" data-action=\"next-period\" aria-label=\"Next period\">\u203a<\/button>\n        <\/div>\n        <label class=\"ts-weekend-option\">\n          <input data-field=\"include-weekends\" type=\"checkbox\" checked>\n          Include weekends\n        <\/label>\n      <\/section>\n\n      <p class=\"ts-period-caption\" data-field=\"period-caption\"><\/p>\n\n      <div class=\"ts-table-wrap\">\n        <table class=\"ts-entry-table\">\n          <thead>\n            <tr>\n              <th scope=\"col\">Date<\/th>\n              <th scope=\"col\">Day<\/th>\n              <th scope=\"col\">Hours worked<\/th>\n            <\/tr>\n          <\/thead>\n          <tbody data-field=\"entries\"><\/tbody>\n        <\/table>\n      <\/div>\n\n      <div class=\"ts-total-row\" aria-live=\"polite\">\n        <span class=\"ts-total-label\" data-field=\"total-label\">Total hours this week<\/span>\n        <strong class=\"ts-total-value\"><span data-field=\"total\">0<\/span><span class=\"ts-total-unit\">hours<\/span><\/strong>\n      <\/div>\n      <p class=\"ts-helper\" data-field=\"weekend-help\">Uncheck \u201cInclude weekends\u201d to hide Saturday and Sunday and exclude them from the total.<\/p>\n    <\/main>\n  <\/div>\n\n  <div class=\"ts-modal-backdrop\" data-role=\"preview-backdrop\" hidden>\n    <section class=\"ts-modal-panel\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"ts-preview-title\">\n      <div class=\"ts-modal-header\">\n        <h3 id=\"ts-preview-title\">Timesheet preview<\/h3>\n        <button class=\"ts-button ts-close-button\" type=\"button\" data-action=\"close-preview\" aria-label=\"Close preview\">\u00d7<\/button>\n      <\/div>\n      <div class=\"ts-preview-sheet\" data-field=\"preview-sheet\"><\/div>\n      <div class=\"ts-modal-actions\">\n        <button class=\"ts-button\" type=\"button\" data-action=\"close-preview\">Back to editing<\/button>\n        <button class=\"ts-button ts-button-primary\" type=\"button\" data-action=\"download-pdf\">Download PDF<\/button>\n      <\/div>\n    <\/section>\n  <\/div>\n\n  <script>\n    (function () {\n      function initializeTimesheets() {\n        document.querySelectorAll('.ts-app').forEach(function (root) {\n          if (root.dataset.tsReady === 'true') return;\n          root.dataset.tsReady = 'true';\n          initializeTimesheet(root);\n        });\n      }\n\n      function initializeTimesheet(root) {\n        var instanceKey = root.dataset.tsInstance || 'default';\n        var storageKey = 'timesheet-studio-v1-' + instanceKey;\n        var employeeInput = root.querySelector('[data-field=\"employee-name\"]');\n        var logoInput = root.querySelector('[data-field=\"logo-file\"]');\n        var logoPreview = root.querySelector('[data-field=\"logo-preview\"]');\n        var removeLogoButton = root.querySelector('[data-action=\"remove-logo\"]');\n        var weekendInput = root.querySelector('[data-field=\"include-weekends\"]');\n        var periodInput = root.querySelector('[data-field=\"period-input\"]');\n        var periodLabel = root.querySelector('[data-field=\"period-input-label\"]');\n        var entriesBody = root.querySelector('[data-field=\"entries\"]');\n        var totalOutput = root.querySelector('[data-field=\"total\"]');\n        var totalLabel = root.querySelector('[data-field=\"total-label\"]');\n        var periodCaption = root.querySelector('[data-field=\"period-caption\"]');\n        var saveStatus = root.querySelector('[data-field=\"save-status\"]');\n        var previewBackdrop = root.querySelector('[data-role=\"preview-backdrop\"]');\n        var previewSheet = root.querySelector('[data-field=\"preview-sheet\"]');\n        var mode = 'week';\n        var anchorDate = new Date();\n        anchorDate.setHours(12, 0, 0, 0);\n        var profile = { employeeName: '', logoData: '', includeWeekends: true };\n        var hoursByDate = {};\n        var storageAvailable = true;\n\n        try {\n          var saved = JSON.parse(window.localStorage.getItem(storageKey) || 'null');\n          if (saved && typeof saved === 'object') {\n            profile.employeeName = typeof saved.employeeName === 'string' ? saved.employeeName : '';\n            profile.logoData = typeof saved.logoData === 'string' && \/^data:image\\\/(png|jpeg|webp);base64,\/i.test(saved.logoData) ? saved.logoData : '';\n            profile.includeWeekends = saved.includeWeekends !== false;\n            hoursByDate = saved.hoursByDate && typeof saved.hoursByDate === 'object' ? saved.hoursByDate : {};\n          }\n        } catch (error) {\n          storageAvailable = false;\n          saveStatus.textContent = 'Browser saving is unavailable';\n        }\n\n        employeeInput.value = profile.employeeName;\n        weekendInput.checked = profile.includeWeekends;\n        updateLogoPreview();\n        updatePeriodInput();\n        renderEntries();\n\n        function pad(value) {\n          return String(value).padStart(2, '0');\n        }\n\n        function toIsoDate(date) {\n          return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate());\n        }\n\n        function fromIsoDate(value) {\n          var parts = value.split('-').map(Number);\n          return new Date(parts[0], parts[1] - 1, parts[2], 12, 0, 0, 0);\n        }\n\n        function addDays(date, amount) {\n          var next = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0, 0);\n          next.setDate(next.getDate() + amount);\n          return next;\n        }\n\n        function startOfWeek(date) {\n          var mondayOffset = (date.getDay() + 6) % 7;\n          return addDays(date, -mondayOffset);\n        }\n\n        function formatDate(date, options) {\n          return new Intl.DateTimeFormat(undefined, options).format(date);\n        }\n\n        function formatHours(value) {\n          var rounded = Math.round((Number(value) || 0) * 100) \/ 100;\n          return String(rounded).replace(\/\\.0+$\/, '').replace(\/(\\.\\d*[1-9])0+$\/, '$1');\n        }\n\n        function escapeHtml(value) {\n          return String(value).replace(\/[&<>\"']\/g, function (character) {\n            return {\n              '&': '&amp;',\n              '<': '&lt;',\n              '>': '&gt;',\n              '\"': '&quot;',\n              \"'\": '&#39;'\n            }[character];\n          });\n        }\n\n        function persist() {\n          profile.employeeName = employeeInput.value;\n          profile.includeWeekends = weekendInput.checked;\n          if (!storageAvailable) return;\n          try {\n            window.localStorage.setItem(storageKey, JSON.stringify({\n              employeeName: profile.employeeName,\n              logoData: profile.logoData,\n              includeWeekends: profile.includeWeekends,\n              hoursByDate: hoursByDate\n            }));\n            saveStatus.textContent = 'Saved in this browser';\n          } catch (error) {\n            saveStatus.textContent = 'Could not save in this browser';\n          }\n        }\n\n        function updateLogoPreview() {\n          if (profile.logoData) {\n            logoPreview.src = profile.logoData;\n            logoPreview.hidden = false;\n            removeLogoButton.hidden = false;\n          } else {\n            logoPreview.removeAttribute('src');\n            logoPreview.hidden = true;\n            removeLogoButton.hidden = true;\n          }\n        }\n\n        function updatePeriodInput() {\n          if (mode === 'week') {\n            periodInput.type = 'date';\n            periodInput.value = toIsoDate(anchorDate);\n            periodInput.setAttribute('aria-label', 'Choose a date in the week');\n            periodLabel.textContent = 'Choose a date in the week';\n            totalLabel.textContent = 'Total hours this week';\n          } else {\n            periodInput.type = 'month';\n            periodInput.value = anchorDate.getFullYear() + '-' + pad(anchorDate.getMonth() + 1);\n            periodInput.setAttribute('aria-label', 'Choose month');\n            periodLabel.textContent = 'Choose month';\n            totalLabel.textContent = 'Total hours this month';\n          }\n        }\n\n        function visibleDates() {\n          var dates = [];\n          if (mode === 'week') {\n            var firstDay = startOfWeek(anchorDate);\n            for (var i = 0; i < 7; i += 1) {\n              var date = addDays(firstDay, i);\n              if (weekendInput.checked || (date.getDay() !== 0 && date.getDay() !== 6)) dates.push(date);\n            }\n            return dates;\n          }\n\n          var monthStart = new Date(anchorDate.getFullYear(), anchorDate.getMonth(), 1, 12, 0, 0, 0);\n          var daysInMonth = new Date(anchorDate.getFullYear(), anchorDate.getMonth() + 1, 0).getDate();\n          for (var day = 1; day <= daysInMonth; day += 1) {\n            var monthDate = new Date(monthStart.getFullYear(), monthStart.getMonth(), day, 12, 0, 0, 0);\n            if (weekendInput.checked || (monthDate.getDay() !== 0 && monthDate.getDay() !== 6)) dates.push(monthDate);\n          }\n          return dates;\n        }\n\n        function currentTotal() {\n          return visibleDates().reduce(function (total, date) {\n            var value = Number(hoursByDate[toIsoDate(date)]);\n            return total + (Number.isFinite(value) && value > 0 ? value : 0);\n          }, 0);\n        }\n\n        function updateCaption() {\n          if (mode === 'week') {\n            var firstDay = startOfWeek(anchorDate);\n            var lastDay = addDays(firstDay, 6);\n            periodCaption.textContent = 'Week: ' + formatDate(firstDay, { day: 'numeric', month: 'short', year: 'numeric' }) +\n              ' \u2013 ' + formatDate(lastDay, { day: 'numeric', month: 'short', year: 'numeric' });\n          } else {\n            periodCaption.textContent = formatDate(anchorDate, { month: 'long', year: 'numeric' });\n          }\n        }\n\n        function renderEntries() {\n          updatePeriodInput();\n          updateCaption();\n          entriesBody.innerHTML = '';\n          visibleDates().forEach(function (date) {\n            var isoDate = toIsoDate(date);\n            var row = document.createElement('tr');\n            row.innerHTML =\n              '<td class=\"ts-date-cell\">' + escapeHtml(formatDate(date, { day: 'numeric', month: 'short' })) + '<\/td>' +\n              '<td class=\"ts-day-cell\">' + escapeHtml(formatDate(date, { weekday: 'long' })) + '<\/td>' +\n              '<td class=\"ts-hours-cell\"><label class=\"ts-sr-only\" for=\"' + root.id + '-hours-' + isoDate + '\">Hours worked on ' +\n              escapeHtml(formatDate(date, { weekday: 'long', day: 'numeric', month: 'long' })) + '<\/label>' +\n              '<input class=\"ts-hours-input\" id=\"' + root.id + '-hours-' + isoDate +\n              '\" type=\"number\" min=\"0\" max=\"24\" step=\"0.25\" inputmode=\"decimal\" placeholder=\"0\" data-date=\"' +\n              isoDate + '\" value=\"' + (hoursByDate[isoDate] !== undefined ? escapeHtml(hoursByDate[isoDate]) : '') + '\"><\/td>';\n            entriesBody.appendChild(row);\n          });\n          totalOutput.textContent = formatHours(currentTotal());\n        }\n\n        function openPreview() {\n          renderPreview();\n          previewBackdrop.hidden = false;\n          var closeButton = root.querySelector('[data-action=\"close-preview\"]');\n          if (closeButton) closeButton.focus();\n        }\n\n        function closePreview() {\n          previewBackdrop.hidden = true;\n          var previewButton = root.querySelector('[data-action=\"preview\"]');\n          if (previewButton) previewButton.focus();\n        }\n\n        function renderPreview() {\n          var dates = visibleDates();\n          var rows = dates.map(function (date) {\n            var isoDate = toIsoDate(date);\n            var hours = Number(hoursByDate[isoDate]) || 0;\n            return '<tr><td>' + escapeHtml(formatDate(date, { weekday: 'short', day: 'numeric', month: 'short', year: 'numeric' })) +\n              '<\/td><td>' + (hours > 0 ? escapeHtml(formatHours(hours)) : '\u2014') + '<\/td><\/tr>';\n          }).join('');\n          var employee = employeeInput.value.trim() || 'Employee';\n          var period = mode === 'week'\n            ? 'Week of ' + formatDate(startOfWeek(anchorDate), { day: 'numeric', month: 'long', year: 'numeric' })\n            : formatDate(anchorDate, { month: 'long', year: 'numeric' });\n          var logo = profile.logoData\n            ? '<img decoding=\"async\" class=\"ts-preview-logo\" src=\"' + profile.logoData + '\" alt=\"Logo\">'\n            : '';\n          previewSheet.innerHTML =\n            '<div class=\"ts-preview-heading\"><div><h2>Timesheet<\/h2><p>' + escapeHtml(period) + '<\/p><\/div>' + logo + '<\/div>' +\n            '<div class=\"ts-preview-meta\"><div><strong>Employee<\/strong><p>' + escapeHtml(employee) + '<\/p><\/div>' +\n            '<div><strong>Period<\/strong><p>' + escapeHtml(period) + '<\/p><\/div><\/div>' +\n            '<table class=\"ts-preview-table\"><thead><tr><th>Date<\/th><th>Hours worked<\/th><\/tr><\/thead><tbody>' + rows +\n            '<\/tbody><\/table><div class=\"ts-preview-total\"><span>Total hours<\/span><span>' +\n            escapeHtml(formatHours(currentTotal())) + '<\/span><\/div>';\n        }\n\n        function printPreview() {\n          renderPreview();\n          if (previewBackdrop.hidden) previewBackdrop.hidden = false;\n\n          var marker = document.createComment('timesheet-studio-position');\n          if (root.parentNode) root.parentNode.insertBefore(marker, root);\n          document.body.appendChild(root);\n          root.classList.add('ts-printing');\n          document.body.classList.add('ts-printing');\n\n          var restored = false;\n          function restoreRoot() {\n            if (restored) return;\n            restored = true;\n            root.classList.remove('ts-printing');\n            document.body.classList.remove('ts-printing');\n            if (marker.parentNode) {\n              marker.parentNode.insertBefore(root, marker);\n              marker.parentNode.removeChild(marker);\n            }\n            window.removeEventListener('afterprint', restoreRoot);\n          }\n\n          window.addEventListener('afterprint', restoreRoot);\n          window.print();\n          window.setTimeout(restoreRoot, 1200);\n        }\n\n        employeeInput.addEventListener('input', persist);\n\n        weekendInput.addEventListener('change', function () {\n          persist();\n          renderEntries();\n        });\n\n        logoInput.addEventListener('change', function () {\n          var file = logoInput.files && logoInput.files[0];\n          if (!file) return;\n          if (!['image\/png', 'image\/jpeg', 'image\/webp'].includes(file.type)) {\n            saveStatus.textContent = 'Choose a PNG, JPG, or WebP logo';\n            logoInput.value = '';\n            return;\n          }\n          if (file.size > 1500000) {\n            saveStatus.textContent = 'Choose a logo smaller than 1.5 MB';\n            logoInput.value = '';\n            return;\n          }\n          var reader = new FileReader();\n          reader.onload = function () {\n            profile.logoData = typeof reader.result === 'string' ? reader.result : '';\n            updateLogoPreview();\n            persist();\n          };\n          reader.onerror = function () {\n            saveStatus.textContent = 'Could not read that logo';\n          };\n          reader.readAsDataURL(file);\n        });\n\n        entriesBody.addEventListener('input', function (event) {\n          var input = event.target.closest('[data-date]');\n          if (!input) return;\n          var date = input.dataset.date;\n          if (input.value === '') {\n            delete hoursByDate[date];\n          } else {\n            var hours = Number(input.value);\n            if (Number.isFinite(hours) && hours >= 0 && hours <= 24) hoursByDate[date] = hours;\n          }\n          persist();\n          totalOutput.textContent = formatHours(currentTotal());\n        });\n\n        periodInput.addEventListener('change', function () {\n          if (!periodInput.value) return;\n          if (mode === 'week') {\n            anchorDate = fromIsoDate(periodInput.value);\n          } else {\n            var parts = periodInput.value.split('-').map(Number);\n            anchorDate = new Date(parts[0], parts[1] - 1, 1, 12, 0, 0, 0);\n          }\n          renderEntries();\n        });\n\n        root.addEventListener('click', function (event) {\n          var modeButton = event.target.closest('[data-mode]');\n          if (modeButton && root.contains(modeButton)) {\n            mode = modeButton.dataset.mode === 'month' ? 'month' : 'week';\n            root.querySelectorAll('[data-mode]').forEach(function (button) {\n              button.setAttribute('aria-pressed', button === modeButton ? 'true' : 'false');\n            });\n            renderEntries();\n            return;\n          }\n\n          var actionButton = event.target.closest('[data-action]');\n          if (!actionButton || !root.contains(actionButton)) return;\n          var action = actionButton.dataset.action;\n          if (action === 'previous-period' || action === 'next-period') {\n            var direction = action === 'previous-period' ? -1 : 1;\n            if (mode === 'week') {\n              anchorDate = addDays(anchorDate, direction * 7);\n            } else {\n              anchorDate = new Date(anchorDate.getFullYear(), anchorDate.getMonth() + direction, 1, 12, 0, 0, 0);\n            }\n            renderEntries();\n          } else if (action === 'preview') {\n            openPreview();\n          } else if (action === 'close-preview') {\n            closePreview();\n          } else if (action === 'download-pdf') {\n            printPreview();\n          } else if (action === 'remove-logo') {\n            profile.logoData = '';\n            logoInput.value = '';\n            updateLogoPreview();\n            persist();\n          }\n        });\n\n        previewBackdrop.addEventListener('click', function (event) {\n          if (event.target === previewBackdrop) closePreview();\n        });\n\n        root.addEventListener('keydown', function (event) {\n          if (event.key === 'Escape' && !previewBackdrop.hidden) closePreview();\n        });\n      }\n\n      initializeTimesheets();\n    })();\n  <\/script>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>I like building websites, particularly designing and installing widgets and plugins. Both the&hellip;<\/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-27","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/pages\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":13,"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/pages\/27\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/pages\/27\/revisions\/65"}],"wp:attachment":[{"href":"https:\/\/busywork.day\/index.php\/wp-json\/wp\/v2\/media?parent=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}