1328
diff --git a/apps/prs/angular/src/app/app.routes.ts b/apps/prs/angular/src/app/app.routes.ts
index a9824d5a7c..8eaa017304 100644
--- a/apps/prs/angular/src/app/app.routes.ts
+++ b/apps/prs/angular/src/app/app.routes.ts
@@ -46,6 +46,7 @@ import { Bug3337Component } from "../routes/bugs/3337/bug3337.component";
import { Bug3279Component } from "../routes/bugs/3279/bug3279.component";
import { Bug3384Component } from "../routes/bugs/3384/bug3384.component";
import { Bug3450Component } from "../routes/bugs/3450/bug3450.component";
+import { Bug3497Component } from "../routes/bugs/3497/bug3497.component";
import { Feat1328Component } from "../routes/features/feat1328/feat1328.component";
import { Feat1383Component } from "../routes/features/feat1383/feat1383.component";
@@ -128,6 +129,7 @@ export const appRoutes: Route[] = [
{ path: "bugs/3279", component: Bug3279Component },
{ path: "bugs/3384", component: Bug3384Component },
{ path: "bugs/3450", component: Bug3450Component },
+ { path: "bugs/3497", component: Bug3497Component },
// Feature routes
{ path: "features/1328", component: Feat1328Component },
diff --git a/apps/prs/angular/src/routes/bugs/3497/bug3497.component.html b/apps/prs/angular/src/routes/bugs/3497/bug3497.component.html
new file mode 100644
index 0000000000..39f59021e6
--- /dev/null
+++ b/apps/prs/angular/src/routes/bugs/3497/bug3497.component.html
@@ -0,0 +1,11 @@
+Bug 3497 Calendar Years Empty
+
+ When [min] or [max] is set to today then the year dropdown is empty and doesn't show
+ anything.
+
+min test
+
+max test
+
+ordinary
+
diff --git a/apps/prs/angular/src/routes/bugs/3497/bug3497.component.ts b/apps/prs/angular/src/routes/bugs/3497/bug3497.component.ts
new file mode 100644
index 0000000000..93011db150
--- /dev/null
+++ b/apps/prs/angular/src/routes/bugs/3497/bug3497.component.ts
@@ -0,0 +1,17 @@
+import { Component, OnInit } from "@angular/core";
+import { CommonModule } from "@angular/common";
+import { GoabCalendar } from "@abgov/angular-components";
+
+@Component({
+ standalone: true,
+ selector: "abgov-bug3497",
+ templateUrl: "./bug3497.component.html",
+ imports: [CommonModule, GoabCalendar],
+})
+export class Bug3497Component implements OnInit {
+ today = new Date();
+
+ ngOnInit() {
+ console.log("today", this.today);
+ }
+}
diff --git a/apps/prs/react/src/app/app.tsx b/apps/prs/react/src/app/app.tsx
index 2e49337cec..eaddafc262 100644
--- a/apps/prs/react/src/app/app.tsx
+++ b/apps/prs/react/src/app/app.tsx
@@ -98,6 +98,7 @@ export function App() {
3279 Work Side Menu Key Nav
3384 v2 Table Border
3450 Dropdown expanding inside Container
+ 3497 Calendar Years Empty
1383 Button Filled Icons
diff --git a/apps/prs/react/src/main.tsx b/apps/prs/react/src/main.tsx
index 1aa291c494..46172adf32 100644
--- a/apps/prs/react/src/main.tsx
+++ b/apps/prs/react/src/main.tsx
@@ -48,6 +48,7 @@ import { Bug3281Route } from "./routes/bugs/bug3281";
import { Bug3337Route } from "./routes/bugs/bug3337";
import { Bug3384Route } from "./routes/bugs/bug3384";
import { Bug3450Route } from "./routes/bugs/bug3450";
+import { Bug3497Route } from "./routes/bugs/bug3497";
import { EverythingRoute } from "./routes/everything";
import { EverythingBRoute } from "./routes/everything-b";
@@ -138,6 +139,7 @@ root.render(
} />
} />
} />
+ } />
} />
} />
@@ -171,8 +173,14 @@ root.render(
} />
} />
} />
- } />
- } />
+ }
+ />
+ }
+ />
} />
} />
diff --git a/apps/prs/react/src/routes/bugs/bug3497.tsx b/apps/prs/react/src/routes/bugs/bug3497.tsx
new file mode 100644
index 0000000000..23705773e4
--- /dev/null
+++ b/apps/prs/react/src/routes/bugs/bug3497.tsx
@@ -0,0 +1,29 @@
+import { GoabBlock, GoabCalendar, GoabText } from "@abgov/react-components";
+
+export function Bug3497Route() {
+ const today = new Date();
+
+ const noop = () => {
+ return null;
+ };
+
+ return (
+
+ Bug 3497 Calendar Years Empty
+
+
+ When min or max is set to today then the year dropdown is empty and doesn't show
+ anything.
+
+
+ min test
+
+
+ max test
+
+
+ ordinary
+
+
+ );
+}
diff --git a/libs/angular-components/src/lib/components/calendar/calendar.spec.ts b/libs/angular-components/src/lib/components/calendar/calendar.spec.ts
index 86fa657a47..f70dd5b146 100644
--- a/libs/angular-components/src/lib/components/calendar/calendar.spec.ts
+++ b/libs/angular-components/src/lib/components/calendar/calendar.spec.ts
@@ -68,8 +68,8 @@ describe("GoABCalendar", () => {
it("should render properties", () => {
const calendar = fixture.nativeElement.querySelector("goa-calendar");
expect(calendar.getAttribute("name")).toBe(component.name);
- expect(calendar.getAttribute("min")).toBe(component.min?.toString());
- expect(calendar.getAttribute("max")).toBe(component.max?.toString());
+ expect(calendar.getAttribute("min")).toBe(component.min?.toISOString());
+ expect(calendar.getAttribute("max")).toBe(component.max?.toISOString());
expect(calendar.getAttribute("testid")).toBe(component.testId);
expect(calendar.getAttribute("mt")).toBe(component.mt);
expect(calendar.getAttribute("mb")).toBe(component.mb);
diff --git a/libs/angular-components/src/lib/components/calendar/calendar.ts b/libs/angular-components/src/lib/components/calendar/calendar.ts
index b437d80e13..326c2b4288 100644
--- a/libs/angular-components/src/lib/components/calendar/calendar.ts
+++ b/libs/angular-components/src/lib/components/calendar/calendar.ts
@@ -20,8 +20,8 @@ import { GoabBaseComponent } from "../base.component";
{
this.isReady = true;
this.cdr.detectChanges();
+ console.log("GoabCalendar initialized with:", this.name, {
+ value: this.value,
+ min: this.min,
+ max: this.max,
+ });
}, 0);
}
diff --git a/libs/web-components/src/components/calendar/Calendar.svelte b/libs/web-components/src/components/calendar/Calendar.svelte
index 3b88a59878..517eae996f 100644
--- a/libs/web-components/src/components/calendar/Calendar.svelte
+++ b/libs/web-components/src/components/calendar/Calendar.svelte
@@ -82,6 +82,12 @@
$: {
_min = min ? new CalendarDate(min) : new CalendarDate().addYears(-5);
_max = max ? new CalendarDate(max) : new CalendarDate().addYears(+5);
+ if (!_min.isValid()) {
+ console.warn(`Invalid min date: ${min}.`);
+ }
+ if (!_max.isValid()) {
+ console.warn(`Invalid max date: ${max}.`);
+ }
// Update years list based on new min/max
const yearStart = _min.year;
diff --git a/netlify.toml b/netlify.toml
index 0c5962c489..e365f3fdf7 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -3,5 +3,5 @@
command = "npm ci && cd docs && npm ci && cd .. && npm run build:prod"
[build.environment]
- NODE_VERSION = "24"
+ NODE_VERSION = "22"
NPM_FLAGS = "--legacy-peer-deps"