From 7b9438bff4b8ed9f5280c8c316c0a4a49c4ad2b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 12:56:16 +0000 Subject: [PATCH 1/4] Initial plan From a7cc5d8824fcbfc9741d867f8ad0093312eac780 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 12:57:57 +0000 Subject: [PATCH 2/4] Add validation for formatDate to prevent RangeError with invalid dates Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com> --- web/src/views/Standups.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/src/views/Standups.vue b/web/src/views/Standups.vue index 6b34606..ed626b7 100644 --- a/web/src/views/Standups.vue +++ b/web/src/views/Standups.vue @@ -350,6 +350,19 @@ export default { } const [year, month, day] = parts.map(Number) + + // Validate that year, month, and day are finite numbers within expected ranges + if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day) || + year < 1000 || year > 9999 || month < 1 || month > 12 || day < 1 || day > 31) { + // Fallback to standard parsing if values are invalid + return new Date(dateString).toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + }) + } + const date = new Date(year, month - 1, day) // Use local timezone with specific date parts return date.toLocaleDateString('en-US', { weekday: 'long', From 1db017ee77768a95cbdec1a942f1d4548677b326 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 12:59:22 +0000 Subject: [PATCH 3/4] Improve date validation: add rollover check and error handling Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com> --- web/src/views/Standups.vue | 47 +++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/web/src/views/Standups.vue b/web/src/views/Standups.vue index ed626b7..d3d70ee 100644 --- a/web/src/views/Standups.vue +++ b/web/src/views/Standups.vue @@ -341,12 +341,18 @@ export default { if (parts.length !== 3) { // Fallback to standard parsing if format is unexpected - return new Date(dateString).toLocaleDateString('en-US', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric' - }) + try { + const date = new Date(dateString) + if (isNaN(date.getTime())) return 'Invalid date' + return date.toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + }) + } catch (e) { + return 'Invalid date' + } } const [year, month, day] = parts.map(Number) @@ -355,15 +361,30 @@ export default { if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day) || year < 1000 || year > 9999 || month < 1 || month > 12 || day < 1 || day > 31) { // Fallback to standard parsing if values are invalid - return new Date(dateString).toLocaleDateString('en-US', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric' - }) + try { + const date = new Date(dateString) + if (isNaN(date.getTime())) return 'Invalid date' + return date.toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + }) + } catch (e) { + return 'Invalid date' + } + } + + // Construct date and validate it matches the input values + const date = new Date(year, month - 1, day) + if (isNaN(date.getTime()) || + date.getFullYear() !== year || + date.getMonth() !== month - 1 || + date.getDate() !== day) { + // Date rolled over (e.g., Feb 31 -> Mar 3), so it's invalid + return 'Invalid date' } - const date = new Date(year, month - 1, day) // Use local timezone with specific date parts return date.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', From 1e530f95ef5448038b1bae0687f11e865ac93231 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 13:00:57 +0000 Subject: [PATCH 4/4] Refactor formatDate: extract fallback parsing to eliminate duplication Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com> --- web/src/views/Standups.vue | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/web/src/views/Standups.vue b/web/src/views/Standups.vue index d3d70ee..c0053b5 100644 --- a/web/src/views/Standups.vue +++ b/web/src/views/Standups.vue @@ -336,11 +336,8 @@ export default { // Treat as date-only value to avoid timezone shifts if (!dateString) return '' - const dateOnly = dateString.includes('T') ? dateString.split('T')[0] : dateString - const parts = dateOnly.split('-') - - if (parts.length !== 3) { - // Fallback to standard parsing if format is unexpected + // Helper function for fallback parsing + const fallbackParse = () => { try { const date = new Date(dateString) if (isNaN(date.getTime())) return 'Invalid date' @@ -355,24 +352,21 @@ export default { } } + const dateOnly = dateString.includes('T') ? dateString.split('T')[0] : dateString + const parts = dateOnly.split('-') + + if (parts.length !== 3) { + // Fallback to standard parsing if format is unexpected + return fallbackParse() + } + const [year, month, day] = parts.map(Number) // Validate that year, month, and day are finite numbers within expected ranges if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day) || year < 1000 || year > 9999 || month < 1 || month > 12 || day < 1 || day > 31) { - // Fallback to standard parsing if values are invalid - try { - const date = new Date(dateString) - if (isNaN(date.getTime())) return 'Invalid date' - return date.toLocaleDateString('en-US', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric' - }) - } catch (e) { - return 'Invalid date' - } + // Values are invalid, return error message + return 'Invalid date' } // Construct date and validate it matches the input values