From bb0b8e64157aca549f36a2a52fb451d2d9f3df3c Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:23:45 +0900 Subject: [PATCH 01/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/en.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site/src/tools/workdays-calculator/messages/en.json b/site/src/tools/workdays-calculator/messages/en.json index 44cc96ad..64e0c43f 100644 --- a/site/src/tools/workdays-calculator/messages/en.json +++ b/site/src/tools/workdays-calculator/messages/en.json @@ -1,7 +1,7 @@ { "title": "Workdays Calculator – Count Working Days Between Two Dates (Free)", "shortDescription": "Count business days between two dates, excluding weekends and any holidays you list. Customizable: include Saturday or Sunday as workdays if needed.", - "description": "Enter a start and end date to see how many workdays (business days) fall between them — weekends and public holidays excluded, both dates counted. Pick a US, UK, Japan or Germany holiday preset or list your own dates. To find the date N workdays after a start date, use the Date Calculator's business-day mode.", + "description": "Choose Date range to count working days between two dates, or 'N workdays from a date' to find a future or past workday. Customize weekends, 2026–2027 US/UK/Japan/Germany holiday presets and your own dates; the start day is excluded in the N-workdays mode.", "metaDescription": "Enter a start and end date to get the number of working days instantly. Skips weekends and US, UK, Japan or Germany holidays, or your own list. Free tool.", "keywords": ["workdays calculator", "business days calculator", "workdays between two dates", "how many workdays between dates", "working days excluding weekends and holidays", "business days excluding holidays", "weekdays between dates", "workdays in 2026"], "empty": "Pick a start and end date to count workdays.", @@ -38,7 +38,7 @@ "heading": "Why we let you customize weekends", "paragraphs": [ "Most countries use Saturday-Sunday as the weekend, but it varies. Most Middle Eastern and some North African countries observe Friday-Saturday as the weekend. Some industries (retail, hospitality) consider weekends as workdays.", - "Our toggles let you mark Saturday or Sunday as workdays individually. So you can configure: Mon-Fri only (default), 6-day work week (include Saturday), or even Sunday-only weekend (uncheck Sunday)." + "You can include Saturday or Sunday as workdays with the toggles, or leave both as weekends (the default). These controls cannot make Friday a weekend, so a Friday–Saturday weekend is not modeled directly here. For legal or contractual deadlines, verify the applicable local calendar rather than relying on this toggle alone." ] }, { @@ -59,8 +59,8 @@ }, "faq": [ { "q": "How many workdays are between two dates?", "a": "Enter both dates: the calculator counts every Monday–Friday in the range (start and end included), then subtracts the public holidays from the preset you pick and any dates you list. Example: July 1–31, 2026 has 23 weekdays; with the US federal holiday preset (Independence Day observed on Friday, July 3) it is 22 workdays." }, - { "q": "How do I find the date that is N workdays after a start date?", "a": "This page counts workdays between two known dates. To go the other way — for example '30 workdays from July 16, 2026' — use the Date Calculator (linked below the tool): turn on business-day mode and pick the same public-holiday preset (US, Japan, UK or Germany, 2026–2027); it skips weekends and those holidays and lists the holidays it skipped. Dates you typed in this page's own holiday list are not carried over, so move that result forward one workday for each such extra day off. To double-check, count here from the day after your start date to the result — it should equal N." }, - { "q": "Are start and end dates inclusive?", "a": "Yes. If both are workdays, both are counted. If your contract counts only the days between (exclusive), subtract 2 from the result." }, + { "q": "How do I find the date that is N workdays after a start date?", "a": "Use the 'N workdays from a date' mode on this calculator, enter a start date and signed number of workdays (negative for earlier dates), then choose the same weekend settings, holiday preset and any custom holiday dates. The start date itself is not counted. All listed custom holidays are applied here; you do not need to transfer them to another calculator. To double-check a positive N, switch to Date range and count from the day after your start date through the result (inclusive) with the same settings." }, + { "q": "Are start and end dates inclusive?", "a": "Yes. A start or end date is counted only if it is a workday after applying your weekend and holiday settings. If you need only dates strictly between them, subtract each distinct endpoint that was actually counted (0, 1 or 2), not always 2. For the same start and end date, the exclusive result is 0." }, { "q": "Are public holidays included automatically?", "a": "Only if you pick a preset: built-in data covers public holidays in the United States, Japan, the United Kingdom (England & Wales) and Germany for 2026–2027. Holidays vary by country, region and year, so for anywhere else — or for company-specific days off — add the dates manually; they are combined with the preset." }, { "q": "Can I use this for international contracts?", "a": "Yes — but make sure both parties agree on which holidays to count. Multinational contracts often specify 'business days as observed in the [city] of [country]' to avoid ambiguity." }, { "q": "What if a holiday falls on a weekend?", "a": "It's not double-counted. If 2026-01-01 is a Thursday holiday, it's counted as a holiday. If 2027-12-25 falls on a Saturday, the algorithm correctly counts it as one day (weekend), not two." }, From 34425153fe3152f69bc34c96249f78f3bd1bd7c4 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:23:48 +0900 Subject: [PATCH 02/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/ja.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/ja.json b/site/src/tools/workdays-calculator/messages/ja.json index be9a83d4..dc2a9a32 100644 --- a/site/src/tools/workdays-calculator/messages/ja.json +++ b/site/src/tools/workdays-calculator/messages/ja.json @@ -66,7 +66,7 @@ ] }, "faq": [ - { "q": "開始日・終了日は両方含む?", "a": "はい。両方が営業日なら両方カウント。「期間中」の意味で両端除外が必要なら結果から2を引いてください。" }, + { "q": "開始日・終了日は両方含む?", "a": "開始日と終了日は、それぞれ設定した土日・祝日条件で営業日に当たる場合に数えます。両端を含まない場合は、実際に数えられた開始日・終了日だけを引いてください(0日・1日・2日のいずれか)。同じ日を開始日と終了日にした場合、両端除外の結果は0日です。一律に2日を引くと誤計算になります。" }, { "q": "祝日は自動で除外される?", "a": "プリセットを選んだ場合のみです。2026〜2027年の米国・日本・英国(イングランド&ウェールズ)・ドイツの祝日を内蔵しています。祝日は国・地域・年で異なるため、それ以外の国や会社独自の休業日(年末年始・夏季休暇など)は手動で日付を追加してください。プリセットと併用できます。" }, { "q": "国際契約に使える?", "a": "使えますが、両当事者がどの祝日を採用するか合意することが重要。国際契約では「[国][都市]の営業日」と明記して曖昧さを避けます。" }, { "q": "祝日が週末と重なるとどうなる?", "a": "二重カウントされません。2026-01-01が木曜なら祝日として1日。2027-12-25が土曜なら、アルゴリズムは正しく1日(週末)として扱います。" }, From bb03f4199b30870168f55243699b72cf9512c08d Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:23:51 +0900 Subject: [PATCH 03/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/es.json b/site/src/tools/workdays-calculator/messages/es.json index d667e504..012f9990 100644 --- a/site/src/tools/workdays-calculator/messages/es.json +++ b/site/src/tools/workdays-calculator/messages/es.json @@ -58,7 +58,7 @@ ] }, "faq": [ - { "q": "¿Inicio y fin son inclusivos?", "a": "Sí. Si ambas son laborables, ambas se cuentan. Si tu contrato cuenta solo días intermedios (exclusivo), resta 2." }, + { "q": "¿Inicio y fin son inclusivos?", "a": "Sí, pero cada extremo solo se cuenta si es laborable según los fines de semana y festivos elegidos. Para contar solo los días estrictamente intermedios, resta cada fecha de inicio o fin distinta que se haya contado (0, 1 o 2), no siempre 2. Si ambas fechas coinciden, el resultado exclusivo es 0." }, { "q": "¿Se incluyen los festivos automáticamente?", "a": "Solo si eliges una plantilla: incluye los festivos oficiales de Estados Unidos, Japón, Reino Unido (Inglaterra y Gales) y Alemania para 2026–2027. Como los festivos varían según el país, la región y el año, para otros países o para días de cierre de tu empresa añade las fechas manualmente; se suman a la plantilla." }, { "q": "¿Sirve para contratos internacionales?", "a": "Sí — pero asegúrate de que ambas partes acuerden qué festivos contar. Contratos multinacionales suelen especificar 'días hábiles según [ciudad] de [país]' para evitar ambigüedad." }, { "q": "¿Si un festivo cae en finde?", "a": "No se cuenta doble. Si 2026-01-01 es jueves festivo, cuenta como festivo. Si 2027-12-25 cae sábado, el algoritmo lo cuenta como un día (finde), no dos." }, From bbe6306272821531bbd2db2839b648a753d64d7c Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:23:54 +0900 Subject: [PATCH 04/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/de.json b/site/src/tools/workdays-calculator/messages/de.json index 77d369ef..55a7bb33 100644 --- a/site/src/tools/workdays-calculator/messages/de.json +++ b/site/src/tools/workdays-calculator/messages/de.json @@ -78,7 +78,7 @@ "faq": [ { "q": "Sind Start- und Enddatum inklusiv?", - "a": "Ja. Wenn beide Arbeitstage sind, werden beide gezählt. Wenn ein Vertrag nur die Tage dazwischen (exklusiv) zählt, 2 vom Ergebnis abziehen." + "a": "Ja, aber Start- und Enddatum zählen jeweils nur, wenn sie nach den gewählten Wochenend- und Feiertagsregeln Arbeitstage sind. Für ausschließlich dazwischenliegende Tage nur die tatsächlich gezählten, unterschiedlichen Endpunkte abziehen (0, 1 oder 2), nicht pauschal 2. Sind beide Daten gleich, ist das exklusive Ergebnis 0." }, { "q": "Werden Feiertage automatisch berücksichtigt?", From c5400eb4aa2c55a0563360da8135d6f28c45674b Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:23:57 +0900 Subject: [PATCH 05/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/fr.json b/site/src/tools/workdays-calculator/messages/fr.json index c9a01a3d..be10dd11 100644 --- a/site/src/tools/workdays-calculator/messages/fr.json +++ b/site/src/tools/workdays-calculator/messages/fr.json @@ -78,7 +78,7 @@ "faq": [ { "q": "Les dates de début et de fin sont-elles incluses ?", - "a": "Oui. Si les deux sont des jours ouvrés, les deux sont comptées. Si ton contrat ne compte que les jours intermédiaires (exclu), soustrais 2 du résultat." + "a": "Oui, mais chaque date de début ou de fin n'est comptée que si elle est ouvrée selon les week-ends et jours fériés choisis. Pour exclure les deux bornes, retranchez seulement chaque borne distincte réellement comptée (0, 1 ou 2), et non systématiquement 2. Si les dates sont identiques, le total exclusif est 0." }, { "q": "Les jours fériés sont-ils inclus automatiquement ?", From f245ff6935527e8913c9f1c15f4dbc7fe90e4378 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:01 +0900 Subject: [PATCH 06/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/it.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/it.json b/site/src/tools/workdays-calculator/messages/it.json index 230da438..017b8104 100644 --- a/site/src/tools/workdays-calculator/messages/it.json +++ b/site/src/tools/workdays-calculator/messages/it.json @@ -78,7 +78,7 @@ "faq": [ { "q": "Le date di inizio e fine sono inclusive?", - "a": "Sì. Se entrambe sono giorni lavorativi, entrambe vengono conteggiate. Se il tuo contratto conta solo i giorni intermedi (esclusivi), sottrai 2 dal risultato." + "a": "Sì, ma ciascuna data iniziale o finale viene conteggiata solo se è lavorativa secondo i weekend e le festività selezionati. Per contare esclusivamente i giorni intermedi, sottrai solo gli estremi distinti effettivamente conteggiati (0, 1 o 2), non sempre 2. Se le date coincidono, il risultato esclusivo è 0." }, { "q": "I festivi sono inclusi automaticamente?", From a1707c071d1c684967b9d11f21cb6bda7da04fa5 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:04 +0900 Subject: [PATCH 07/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/pt-BR.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/pt-BR.json b/site/src/tools/workdays-calculator/messages/pt-BR.json index 9ee11d6b..0a570ef5 100644 --- a/site/src/tools/workdays-calculator/messages/pt-BR.json +++ b/site/src/tools/workdays-calculator/messages/pt-BR.json @@ -78,7 +78,7 @@ "faq": [ { "q": "As datas de início e fim são inclusivas?", - "a": "Sim. Se ambas forem dias úteis, ambas são contadas. Se o seu contrato contar apenas os dias entre (exclusivo), subtraia 2 do resultado." + "a": "Sim, mas cada data inicial ou final só é contada se for dia útil conforme os fins de semana e feriados escolhidos. Para contar apenas as datas estritamente entre elas, subtraia somente os extremos distintos que realmente foram contados (0, 1 ou 2), nunca 2 automaticamente. Se as datas coincidirem, o resultado exclusivo é 0." }, { "q": "Os feriados são incluídos automaticamente?", From 60486e33097cce3fac854e922b6e802be933c584 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:07 +0900 Subject: [PATCH 08/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/ar.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/ar.json b/site/src/tools/workdays-calculator/messages/ar.json index 7ce8a672..7d96621d 100644 --- a/site/src/tools/workdays-calculator/messages/ar.json +++ b/site/src/tools/workdays-calculator/messages/ar.json @@ -58,7 +58,7 @@ ] }, "faq": [ - { "q": "هل تاريخي البداية والنهاية شاملان؟", "a": "نعم. إذا كانا كلاهما أيام عمل، كلاهما يُحسبان. إذا كان عقدك يحسب فقط الأيام بينهما (حصري)، اطرح 2 من النتيجة." }, + { "q": "هل تاريخي البداية والنهاية شاملان؟", "a": "نعم، لكن يُحسب تاريخ البداية أو النهاية فقط إذا كان يوم عمل وفق إعدادات عطلة الأسبوع والعطلات الرسمية المختارة. لحساب الأيام الواقعة بين التاريخين دون الطرفين، اطرح فقط كل طرف مختلف تم احتسابه فعلاً (0 أو 1 أو 2)، ولا تطرح 2 تلقائياً. إذا تساوى التاريخان فالناتج دون الطرفين يساوي 0." }, { "q": "هل تُستبعد العطل الرسمية تلقائياً؟", "a": "فقط إذا اخترت قالباً جاهزاً: تتضمن الأداة العطل الرسمية للولايات المتحدة واليابان والمملكة المتحدة (إنجلترا وويلز) وألمانيا لعامي 2026–2027. ولأن العطل تختلف حسب البلد والمنطقة والسنة، أضف التواريخ يدوياً للدول الأخرى أو لأيام إغلاق شركتك؛ وتُجمع مع القالب." }, { "q": "هل يمكنني استخدام هذا لعقود دولية؟", "a": "نعم — لكن تأكد أن كلا الطرفين يتفقان على الإجازات التي يجب حسابها. العقود متعددة الجنسيات غالباً تحدد 'أيام عمل كما يُلتزم بها في [مدينة] [بلد]' لتجنب الغموض." }, { "q": "ماذا إذا وقعت إجازة في عطلة نهاية الأسبوع؟", "a": "لا تُحسب مرتين. إذا كان 2026-01-01 إجازة الخميس، يُحسب كإجازة. إذا وقع 2027-12-25 يوم السبت، الخوارزمية تحسبه بشكل صحيح كيوم واحد (عطلة نهاية الأسبوع)، ليس اثنين." }, From 7e52af9b79220ef8af42a88906202403a02815bb Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:11 +0900 Subject: [PATCH 09/39] fix(i18n): correct workday boundary-count explanation and mode guidance --- site/src/tools/workdays-calculator/messages/zh-CN.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/zh-CN.json b/site/src/tools/workdays-calculator/messages/zh-CN.json index edc2145c..5828a0f3 100644 --- a/site/src/tools/workdays-calculator/messages/zh-CN.json +++ b/site/src/tools/workdays-calculator/messages/zh-CN.json @@ -58,7 +58,7 @@ ] }, "faq": [ - { "q": "起止日期都包含吗?", "a": "是的。两个都是工作日则都计入。如果你的合同只算之间的天数 (不含两端), 从结果减 2。" }, + { "q": "起止日期都包含吗?", "a": "包含,但开始日和结束日只有在符合所选周末及节假日规则、属于工作日时才计入。如果只计算两端之间的工作日,仅减去确实被计入的不同端点(0、1或2天),不能一律减2。同一天作为开始和结束时,排除两端后的结果为0。" }, { "q": "会自动排除法定节假日吗?", "a": "仅在选择预设时会。内置了美国、日本、英国(英格兰和威尔士)和德国 2026–2027 年的公共假日。由于节假日因国家、地区和年份而异,其他国家或公司自定的休息日请手动添加日期,会与预设合并计算。" }, { "q": "可以用于国际合同?", "a": "可以 — 但确保双方就采用哪些节假日达成一致。跨国合同常指定「[国家][城市]奉行的营业日」以避免歧义。" }, { "q": "节假日落在周末怎么办?", "a": "不会双重计算。如果 2026-01-01 是周四节假日, 算 1 天节假日。如果 2027-12-25 落在周六, 算法正确计为 1 天 (周末) 而非 2 天。" }, From ebe4e84029d8d15a62badaa1c168eb5aba00d3b4 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:35 +0900 Subject: [PATCH 10/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/zh-TW.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/zh-TW.json b/site/src/tools/workdays-calculator/messages/zh-TW.json index 6d6bb3f1..7e4e911c 100644 --- a/site/src/tools/workdays-calculator/messages/zh-TW.json +++ b/site/src/tools/workdays-calculator/messages/zh-TW.json @@ -78,7 +78,7 @@ "faq": [ { "q": "起止日期都包含嗎?", - "a": "是的。兩個都是工作日則都計入。如果你的合同只算之間的天數 (不含兩端), 從結果減 2。" + "a": "包含,但開始日和結束日只有在符合所選週末及國定假日規則、屬於工作日時才計入。若只計算兩端之間的工作日,僅扣除確實計入的不同端點(0、1或2天),不能一律減2。同一天為開始和結束日時,排除兩端後的結果為0。" }, { "q": "會自動排除國定假日嗎?", From 0e344a3f4d47bae225b8e3cc784f06cbd457cc02 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:39 +0900 Subject: [PATCH 11/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/ko.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/ko.json b/site/src/tools/workdays-calculator/messages/ko.json index cf501945..7e3912c5 100644 --- a/site/src/tools/workdays-calculator/messages/ko.json +++ b/site/src/tools/workdays-calculator/messages/ko.json @@ -58,7 +58,7 @@ ] }, "faq": [ - { "q": "시작과 종료 날짜 포함?", "a": "네. 둘 다 근무일이면 둘 다 카운트. 계약이 사이의 일만 카운트하면(배타적) 결과에서 2 빼기." }, + { "q": "시작과 종료 날짜 포함?", "a": "시작일과 종료일은 설정한 주말·공휴일 규칙에 따라 실제 근무일일 때만 각각 포함됩니다. 양 끝 날짜를 제외하려면 실제로 계산에 포함된 서로 다른 양 끝 날짜만 빼세요(0일, 1일 또는 2일). 무조건 2일을 빼면 안 됩니다. 시작일과 종료일이 같은 날이면 양 끝 제외 결과는 0일입니다." }, { "q": "공휴일이 자동으로 제외되나요?", "a": "프리셋을 선택한 경우에만 그렇습니다. 2026~2027년 미국·일본·영국(잉글랜드·웨일스)·독일의 공휴일이 내장되어 있습니다. 공휴일은 국가·지역·연도마다 다르므로, 그 밖의 국가나 회사 자체 휴무일은 날짜를 직접 추가하세요. 프리셋과 함께 적용됩니다." }, { "q": "국제 계약에 사용?", "a": "네 — 그러나 양쪽이 어떤 휴일 카운트할지 동의 확인. 다국적 계약이 종종 모호 회피에 '[국가]의 [도시]에서 관찰되는 영업일' 명시." }, { "q": "휴일이 주말에 떨어지면?", "a": "이중 카운트 안 됨. 2026-01-01이 목요일 휴일이면 휴일로 카운트. 2027-12-25가 토요일에 떨어지면 알고리즘이 두 번 아닌 한 번(주말)으로 올바르게 카운트." }, From 1efa1160f32e4533bfcddfd5cd727ff7761fb82a Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:42 +0900 Subject: [PATCH 12/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/hi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/hi.json b/site/src/tools/workdays-calculator/messages/hi.json index f0e51771..99856839 100644 --- a/site/src/tools/workdays-calculator/messages/hi.json +++ b/site/src/tools/workdays-calculator/messages/hi.json @@ -78,7 +78,7 @@ "faq": [ { "q": "क्या start और end dates inclusive हैं?", - "a": "हाँ। दोनों workdays हों तो दोनों count होती हैं। यदि आपका contract केवल बीच के days count करे (exclusive), result में से 2 subtract करें।" + "a": "हाँ, लेकिन start और end में से हर तारीख तभी गिनी जाती है जब आपके चुने गए weekend और holiday नियमों के अनुसार वह workday हो। केवल बीच के दिन गिनने के लिए वास्तव में गिने गए अलग-अलग endpoints ही घटाएँ (0, 1 या 2), हमेशा 2 नहीं। यदि दोनों तारीखें एक ही दिन हैं तो exclusive परिणाम 0 होगा।" }, { "q": "क्या सार्वजनिक छुट्टियाँ अपने-आप घटाई जाती हैं?", From 262307a7e59742e66d386c88380e1d19de07fca7 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:45 +0900 Subject: [PATCH 13/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/id.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/id.json b/site/src/tools/workdays-calculator/messages/id.json index 27201923..f8995e6a 100644 --- a/site/src/tools/workdays-calculator/messages/id.json +++ b/site/src/tools/workdays-calculator/messages/id.json @@ -78,7 +78,7 @@ "faq": [ { "q": "Apakah tanggal mulai dan akhir inklusif?", - "a": "Ya. Jika keduanya adalah hari kerja, keduanya dihitung. Jika kontrak Anda menghitung hanya hari di antara keduanya (eksklusif), kurangi 2 dari hasilnya." + "a": "Ya, tetapi tanggal mulai atau akhir hanya dihitung jika merupakan hari kerja menurut aturan akhir pekan dan libur yang dipilih. Untuk menghitung tanggal di antaranya saja, kurangi hanya titik batas berbeda yang benar-benar ikut dihitung (0, 1, atau 2), bukan selalu 2. Jika tanggalnya sama, hasil eksklusif adalah 0." }, { "q": "Apakah hari libur disertakan otomatis?", From 503dedd0639e6d1777837c6091edbd08d3f8f136 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:48 +0900 Subject: [PATCH 14/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/ru.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/ru.json b/site/src/tools/workdays-calculator/messages/ru.json index a03c1cc5..72660f58 100644 --- a/site/src/tools/workdays-calculator/messages/ru.json +++ b/site/src/tools/workdays-calculator/messages/ru.json @@ -58,7 +58,7 @@ ] }, "faq": [ - { "q": "Начальная и конечная даты включены?", "a": "Да. Если обе даты рабочие, обе считаются. Если договор считает только дни между датами (исключительно), вычтите 2 из результата." }, + { "q": "Начальная и конечная даты включены?", "a": "Да, но начальная и конечная даты учитываются по отдельности лишь в том случае, если это рабочие дни с учётом настроек выходных и праздников. Для подсчёта только промежуточных дней вычитайте лишь фактически учтённые разные границы (0, 1 или 2), а не всегда 2. Если даты совпадают, результат без границ равен 0." }, { "q": "Учитываются ли праздники автоматически?", "a": "Только если выбрать шаблон: встроены официальные праздники США, Японии, Великобритании (Англия и Уэльс) и Германии на 2026–2027 годы. Праздники зависят от страны, региона и года, поэтому для других стран или корпоративных выходных добавьте даты вручную — они суммируются с шаблоном." }, { "q": "Можно ли использовать это для международных договоров?", "a": "Да — но убедитесь, что обе стороны согласны с тем, какие праздники считать. В международных договорах часто указывают «рабочие дни как наблюдается в [город] [страна]» во избежание неоднозначности." }, { "q": "Что если праздник приходится на выходной?", "a": "Он не считается дважды. Если 1 января — четверг и праздник, он учитывается как праздник. Если 7 января — воскресенье, алгоритм правильно считает его как один день (выходной), а не два." }, From a2827de210e8fd0b0b80560898cc7d8db278c629 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:51 +0900 Subject: [PATCH 15/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/th.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/th.json b/site/src/tools/workdays-calculator/messages/th.json index 3035d9c8..e6257f70 100644 --- a/site/src/tools/workdays-calculator/messages/th.json +++ b/site/src/tools/workdays-calculator/messages/th.json @@ -78,7 +78,7 @@ "faq": [ { "q": "วันเริ่มและสิ้นสุดรวมหรือไม่?", - "a": "ใช่ ถ้าทั้งคู่เป็นวันทำงาน ทั้งสองนับ ถ้าสัญญาของคุณนับเฉพาะวันระหว่าง (ไม่รวม) ลบ 2 จากผลลัพธ์" + "a": "รวมวันเริ่มต้นและวันสิ้นสุดเฉพาะเมื่อแต่ละวันเป็นวันทำงานตามการตั้งค่าวันหยุดสุดสัปดาห์และวันหยุดราชการ หากต้องการนับเฉพาะวันระหว่างสองวัน ให้หักเฉพาะวันขอบเขตที่แตกต่างกันและถูกนับจริง (0, 1 หรือ 2 วัน) ไม่ใช่หัก 2 วันเสมอ หากวันเริ่มและสิ้นสุดตรงกัน ผลแบบไม่รวมขอบเขตคือ 0" }, { "q": "วันหยุดราชการถูกหักออกอัตโนมัติไหม?", From aea34ca9f1f9d3f90efd315f507bc086c6c6804b Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:55 +0900 Subject: [PATCH 16/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/tr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/tr.json b/site/src/tools/workdays-calculator/messages/tr.json index b29bea8a..4b3b5d07 100644 --- a/site/src/tools/workdays-calculator/messages/tr.json +++ b/site/src/tools/workdays-calculator/messages/tr.json @@ -58,7 +58,7 @@ ] }, "faq": [ - { "q": "Başlangıç ve bitiş tarihleri dahil mi?", "a": "Evet. İkisi de iş günüyse, ikisi de sayılır. Sözleşmeniz yalnızca aradaki günleri sayıyorsa (hariç), sonuçtan 2 çıkarın." }, + { "q": "Başlangıç ve bitiş tarihleri dahil mi?", "a": "Evet, ancak başlangıç ve bitiş tarihleri yalnızca seçtiğiniz hafta sonu ve tatil kurallarına göre iş günü olduklarında sayılır. Yalnızca aradaki günleri hesaplamak için gerçekten sayılan farklı uç tarihleri çıkarın (0, 1 veya 2); otomatik olarak 2 çıkarmayın. İki tarih aynıysa uçlar hariç sonuç 0'dır." }, { "q": "Resmî tatiller otomatik olarak düşülüyor mu?", "a": "Yalnızca bir hazır liste seçerseniz: ABD, Japonya, Birleşik Krallık (İngiltere ve Galler) ve Almanya'nın 2026–2027 resmî tatilleri yerleşiktir. Tatiller ülkeye, bölgeye ve yıla göre değiştiğinden, diğer ülkeler veya şirketinize özgü izin günleri için tarihleri elle ekleyin; hazır listeyle birleştirilir." }, { "q": "Uluslararası sözleşmeler için kullanabilir miyim?", "a": "Evet — ancak her iki tarafın hangi tatilleri sayacağında anlaşmasını sağlayın. Çok uluslu sözleşmeler belirsizliği önlemek için genellikle '[ülke]'nin [şehir]'inde gözlemlenen iş günleri' belirtir." }, { "q": "Tatil hafta sonuna denk gelirse ne olur?", "a": "Çift sayılmaz. 2026-01-01 Perşembe tatiliyse, tatil olarak sayılır. 2027-12-25 Cumartesi'ye denk gelirse, algoritma onu doğru olarak bir gün (hafta sonu) sayar, iki değil." }, From bc6f5cc4c73b6ab7e628dc612e4c5c09f60b0862 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:24:58 +0900 Subject: [PATCH 17/39] fix(i18n): avoid subtracting two workdays for nonworkday endpoints --- site/src/tools/workdays-calculator/messages/vi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/tools/workdays-calculator/messages/vi.json b/site/src/tools/workdays-calculator/messages/vi.json index 1d28da00..688ce914 100644 --- a/site/src/tools/workdays-calculator/messages/vi.json +++ b/site/src/tools/workdays-calculator/messages/vi.json @@ -58,7 +58,7 @@ ] }, "faq": [ - { "q": "Ngày bắt đầu và kết thúc có được tính không?", "a": "Có. Nếu cả hai là ngày làm việc, cả hai được đếm. Nếu hợp đồng chỉ đếm ngày ở giữa (loại trừ), trừ 2 khỏi kết quả." }, + { "q": "Ngày bắt đầu và kết thúc có được tính không?", "a": "Có, nhưng ngày bắt đầu và ngày kết thúc chỉ được tính nếu từng ngày là ngày làm việc theo thiết lập cuối tuần và ngày lễ. Nếu chỉ tính những ngày nằm giữa hai mốc, chỉ trừ các mốc khác nhau thực sự đã được đếm (0, 1 hoặc 2), không phải luôn trừ 2. Nếu hai ngày trùng nhau, kết quả loại cả hai đầu là 0." }, { "q": "Ngày lễ có được tự động loại trừ không?", "a": "Chỉ khi bạn chọn mẫu có sẵn: công cụ có sẵn ngày lễ chính thức của Mỹ, Nhật Bản, Vương quốc Anh (Anh và xứ Wales) và Đức cho 2026–2027. Vì ngày lễ khác nhau theo quốc gia, khu vực và năm, với các nước khác hoặc ngày nghỉ riêng của công ty, hãy nhập ngày thủ công; chúng được cộng thêm vào mẫu." }, { "q": "Có dùng cho hợp đồng quốc tế được không?", "a": "Có — nhưng đảm bảo cả hai bên đồng ý dùng ngày lễ nào. Hợp đồng đa quốc gia thường ghi rõ 'ngày làm việc theo lịch tại [thành phố] của [quốc gia]' để tránh mơ hồ." }, { "q": "Nếu ngày lễ rơi vào cuối tuần thì sao?", "a": "Không bị đếm trùng. Nếu 2026-01-01 là thứ Năm ngày lễ, nó được đếm là ngày lễ. Nếu 2027-12-25 rơi vào thứ Bảy, thuật toán đếm đúng là một ngày (cuối tuần), không phải hai." }, From 7322f8e5d7f4d2ae412d76f3f3059876096859c1 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:26:41 +0900 Subject: [PATCH 18/39] feat(workdays): extract local-date range math with optional exclusive endpoints --- .../workdays-calculator/workday-range.ts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 site/src/tools/workdays-calculator/workday-range.ts diff --git a/site/src/tools/workdays-calculator/workday-range.ts b/site/src/tools/workdays-calculator/workday-range.ts new file mode 100644 index 00000000..cf556318 --- /dev/null +++ b/site/src/tools/workdays-calculator/workday-range.ts @@ -0,0 +1,49 @@ +/** + * Calendar-day workday counting, using local dates (never UTC ISO conversion). + * Both ends are included by default. In exclusive mode only dates strictly + * between the start/end are counted, so holidays/weekends on the boundaries + * are never incorrectly subtracted from a result. + */ +export type WorkdayRangeResult = { + workdays: number; + weekendDays: number; + holidayDays: number; + total: number; +}; + +export function isoDate(d: Date): string { + return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`; +} + +export function countWorkdays( + start: Date, + end: Date, + weekend: Set, + holidays: Set, + excludeEndpoints = false, +): WorkdayRangeResult { + const zero = { workdays: 0, weekendDays: 0, holidayDays: 0, total: 0 }; + if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime()) || start > end) return zero; + let workdays = 0; + let weekendDays = 0; + let holidayDays = 0; + let total = 0; + const cur = new Date(start); + const last = new Date(end); + if (excludeEndpoints) { + cur.setDate(cur.getDate() + 1); + last.setDate(last.getDate() - 1); + } + while (cur <= last) { + total++; + if (weekend.has(cur.getDay())) { + weekendDays++; + } else if (holidays.has(isoDate(cur))) { + holidayDays++; + } else { + workdays++; + } + cur.setDate(cur.getDate() + 1); + } + return { workdays, weekendDays, holidayDays, total }; +} From ba37faefd54118eb06817fccdcd80fb52c1af8de Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:26:43 +0900 Subject: [PATCH 19/39] test(workdays): prove inclusive/exclusive behavior across weekends and holidays --- .../workdays-calculator/workday-range.test.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 site/src/tools/workdays-calculator/workday-range.test.ts diff --git a/site/src/tools/workdays-calculator/workday-range.test.ts b/site/src/tools/workdays-calculator/workday-range.test.ts new file mode 100644 index 00000000..5ce5b45c --- /dev/null +++ b/site/src/tools/workdays-calculator/workday-range.test.ts @@ -0,0 +1,44 @@ +import { describe, expect, it } from "vitest"; +import { countWorkdays, isoDate } from "./workday-range"; + +const d = (date: string) => new Date(date + "T00:00:00"); +const weekend = new Set([0, 6]); +const none = new Set(); + +describe("workdays inclusive/exclusive boundaries", () => { + it("counts the two weekdays Friday-to-Monday inclusively", () => { + expect(countWorkdays(d("2026-01-02"), d("2026-01-05"), weekend, none)) + .toEqual({ workdays: 2, weekendDays: 2, holidayDays: 0, total: 4 }); + }); + it("excludes both boundary weekdays without subtracting weekend days", () => { + expect(countWorkdays(d("2026-01-02"), d("2026-01-05"), weekend, none, true)) + .toEqual({ workdays: 0, weekendDays: 2, holidayDays: 0, total: 2 }); + }); + it("does not subtract two workdays when Saturday is a boundary", () => { + expect(countWorkdays(d("2026-01-03"), d("2026-01-05"), weekend, none, true)) + .toEqual({ workdays: 0, weekendDays: 1, holidayDays: 0, total: 1 }); + }); + it("same date exclusive has zero calendar days, not negative days", () => { + expect(countWorkdays(d("2026-01-05"), d("2026-01-05"), weekend, none, true)) + .toEqual({ workdays: 0, weekendDays: 0, holidayDays: 0, total: 0 }); + }); + it("adjacent weekdays exclusive has zero days", () => { + expect(countWorkdays(d("2026-01-05"), d("2026-01-06"), weekend, none, true).total).toBe(0); + }); + it("excludes listed holiday inside range and honors a holiday on endpoint", () => { + const holidays = new Set(["2026-01-05", "2026-01-06"]); + expect(countWorkdays(d("2026-01-05"), d("2026-01-07"), weekend, holidays, true)) + .toEqual({ workdays: 0, weekendDays: 0, holidayDays: 1, total: 1 }); + }); + it("supports customized Saturday workday rules", () => { + expect(countWorkdays(d("2026-01-02"), d("2026-01-05"), new Set([0]), none, true)) + .toEqual({ workdays: 1, weekendDays: 1, holidayDays: 0, total: 2 }); + }); + it("rejects reversed or invalid ranges without negative counts", () => { + expect(countWorkdays(d("2026-01-06"), d("2026-01-02"), weekend, none, true).total).toBe(0); + expect(countWorkdays(new Date(NaN), d("2026-01-02"), weekend, none).total).toBe(0); + }); + it("uses local calendar date formatting even in offset timezones", () => { + expect(isoDate(d("2026-01-05"))).toBe("2026-01-05"); + }); +}); From 2a68804a2fcae66868352e3ad07b50e319073b8b Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:26:46 +0900 Subject: [PATCH 20/39] feat(workdays): add shareable exclusive-boundaries option and zero-day result --- .../tools/workdays-calculator/Component.tsx | 59 ++++++------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/site/src/tools/workdays-calculator/Component.tsx b/site/src/tools/workdays-calculator/Component.tsx index b5e49d2f..b016dd77 100644 --- a/site/src/tools/workdays-calculator/Component.tsx +++ b/site/src/tools/workdays-calculator/Component.tsx @@ -4,6 +4,7 @@ import { useMemo, useState } from "react"; import { useLocale, useTranslations } from "next-intl"; import { useShareableState } from "@/lib/hooks/useShareableState"; import { HOLIDAY_PRESETS, type HolidayCountry } from "./holidays"; +import { countWorkdays, isoDate } from "./workday-range"; const PRESET_OPTIONS = ["", "US", "JP", "UK", "DE"] as const; @@ -16,40 +17,6 @@ function parseHolidays(input: string): Set { ); } -// Local calendar date → "yyyy-mm-dd". (toISOString() is UTC: east of UTC — e.g. JST — it shifted -// every day back by one, so preset holidays matched the wrong weekday.) -function isoDate(d: Date): string { - return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`; -} - -function countWorkdays( - start: Date, - end: Date, - weekend: Set, - holidays: Set, -): { workdays: number; weekendDays: number; holidayDays: number; total: number } { - if (start > end) return { workdays: 0, weekendDays: 0, holidayDays: 0, total: 0 }; - let workdays = 0; - let weekendDays = 0; - let holidayDays = 0; - let total = 0; - const cur = new Date(start); - while (cur <= end) { - total++; - const dow = cur.getDay(); - const dStr = isoDate(cur); - if (weekend.has(dow)) { - weekendDays++; - } else if (holidays.has(dStr)) { - holidayDays++; - } else { - workdays++; - } - cur.setDate(cur.getDate() + 1); - } - return { workdays, weekendDays, holidayDays, total }; -} - // start から n 営業日後(n<0 は前)の日付。開始日自体は数えない。 function addWorkdays(start: Date, n: number, weekend: Set, holidays: Set): Date | null { const step = n < 0 ? -1 : 1; @@ -73,6 +40,7 @@ export default function WorkdaysCalculator() { const [end, setEnd] = useState(futureStr); const [includeSat, setIncludeSat] = useState(false); const [includeSun, setIncludeSun] = useState(false); + const [excludeEndpoints, setExcludeEndpoints] = useState(false); const [holidays, setHolidays] = useState(""); const [preset, setPreset] = useState<"" | HolidayCountry>(""); const [mode, setMode] = useState<"range" | "add">("range"); @@ -80,7 +48,7 @@ export default function WorkdaysCalculator() { useShareableState( "workdays-calculator", - { mode, start, end, days, includeSat, includeSun, holidays, preset }, + { mode, start, end, days, includeSat, includeSun, excludeEndpoints, holidays, preset }, (d) => { if (d.mode === "range" || d.mode === "add") setMode(d.mode); if (typeof d.start === "string") setStart(d.start); @@ -88,6 +56,7 @@ export default function WorkdaysCalculator() { if (typeof d.days === "string") setDays(d.days); if (typeof d.includeSat === "boolean") setIncludeSat(d.includeSat); if (typeof d.includeSun === "boolean") setIncludeSun(d.includeSun); + if (typeof d.excludeEndpoints === "boolean") setExcludeEndpoints(d.excludeEndpoints); if (typeof d.holidays === "string") setHolidays(d.holidays); if (d.preset === "" || (typeof d.preset === "string" && d.preset in HOLIDAY_PRESETS)) setPreset(d.preset as "" | HolidayCountry); }, @@ -95,8 +64,10 @@ export default function WorkdaysCalculator() { const presetInRange = useMemo(() => { if (!preset) return []; - return HOLIDAY_PRESETS[preset].filter((h) => h.date >= start && h.date <= end); - }, [preset, start, end]); + return HOLIDAY_PRESETS[preset].filter((h) => + h.date >= start && h.date <= end && !(mode === "range" && excludeEndpoints && (h.date === start || h.date === end)) + ); + }, [preset, start, end, mode, excludeEndpoints]); const afterDate = useMemo(() => { if (mode !== "add") return null; @@ -122,8 +93,8 @@ export default function WorkdaysCalculator() { if (preset) { for (const h of HOLIDAY_PRESETS[preset]) hSet.add(h.date); } - return countWorkdays(sd, ed, weekend, hSet); - }, [start, end, includeSat, includeSun, holidays, preset]); + return countWorkdays(sd, ed, weekend, hSet, excludeEndpoints); + }, [start, end, includeSat, includeSun, excludeEndpoints, holidays, preset]); const dateFmt = useMemo( () => new Intl.DateTimeFormat(locale, { month: "short", day: "numeric", year: "numeric", weekday: "short" }), @@ -131,7 +102,7 @@ export default function WorkdaysCalculator() { ); // GA4 calculate の label(ToolInteractionTracker が読む)。祝日プリセットと週末設定のみ=日付は送らない。 - const calcLabel = `${mode === "add" ? "add:" : ""}${preset || "none"}${includeSat ? "+sat" : ""}${includeSun ? "+sun" : ""}`; + const calcLabel = `${mode === "add" ? "add:" : ""}${preset || "none"}${includeSat ? "+sat" : ""}${includeSun ? "+sun" : ""}${mode === "range" && excludeEndpoints ? "+exclusive" : ""}`; return (
@@ -167,6 +138,12 @@ export default function WorkdaysCalculator() { setIncludeSun(e.target.checked)} /> {t("input.includeSun")} + {mode === "range" && ( + + )}