Skip to content

Workdays Calculator: exclusive-date mode and accurate guidance in 17 languages - #93

Merged
appdevelopsk merged 39 commits into
mainfrom
fix/workdays-worldwide-faq-accuracy-20261114
Nov 14, 2026
Merged

appdevelopsk merged 39 commits into
mainfrom
fix/workdays-worldwide-faq-accuracy-20261114

Conversation

@appdevelopsk

Copy link
Copy Markdown
Owner

Why this matters for real users

Public Toolify365 /en/tools/workdays-calculator currently says to always subtract 2 to calculate days strictly between two dates; that fails when either boundary is a weekend/holiday, and fails for same-day ranges. The same incorrect advice exists in all 17 localized FAQ files. The English FAQ also wrongly sends people to a separate Date Calculator to add N workdays, despite this tool already having N workdays from a date mode with its own custom holiday list. These are concrete usability/trust bugs in a high-intent business-day tool, not speculative SEO gains.

Actual implementation

  • Extract local-calendar math to site/src/tools/workdays-calculator/workday-range.ts, preserving inclusive behavior by default and adding optional excludeEndpoints that skips the actual boundary dates without falsely subtracting two business days. Weekend, custom holidays and preset holidays follow existing behavior; reversed/invalid ranges return safe zeros.
  • Provide Exclude start and end dates checkbox in Date range mode only, persist in existing shareable-state flow, label anonymous GA4 interaction as +exclusive without sending dates or user-input values, show zero correctly for same-day exclusive ranges, filter excluded holidays from the displayed in-range holiday list.
  • Add an actual translated checkbox label and corrected FAQ in all 17 active locales. English FAQ now points to the already-present N-workdays mode and confirms pasted custom holiday dates are used directly; warns that Friday–Saturday weekends cannot be modeled with Sat/Sun-only toggles.
  • Add nine Vitest cases in workday-range.test.ts (inclusive, both weekdays, one weekend endpoint, same day, adjacent dates, holiday, Saturday workweek, reverse/invalid range, timezone-safe local date).
  • Add dependency-free site/scripts/workdays-faq-parity.test.mjs validating every language's label/FAQ and component binding; enforce in site/package.json prebuild and expose npm test:workdays-faq.

Tests and limits

  • All 17 locale JSON blobs re-fetched from the exact GitHub branch and parsed; all contain their new localized label and consistent 0/1/2 endpoint advice, existing range/add modes preserved. Component/source 10 invariants passed.
  • A faithful isolated copy of the new pure TypeScript math compiled with installed TypeScript (tsc --strict --target ES2022 --module commonjs) and ran 9/9 Node test cases successfully using Node 22. This is NOT a full npm test/Next.js build from the original checkout.
  • No full repo CI/Actions, npm test, npm run typecheck, npm run build, mobile browser preview, live production release or real-visitor measurement was performed. The existing Toolify draft PR Toolify post-merge: safe embeds, share UX and manual-only Actions for all workflows (DRAFT) #41 remains separate; its 21 changed files do not overlap this focused workdays + locale change.

Deployment checks

Before publishing, run from site/: npm run test:workdays-faq && npm test -- workday-range.test.ts && npm run typecheck && npm run build, inspect EN/JA/AR mobile layout, share-state restore, exact holiday calculations and signed N-workdays mode. After authorized deployment check visible public HTML and use real-user interactions with GA4 session data/log filtering (not raw bot-inflated sessions). No active-user uplift is claimed by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant