Skip to content

feat(DatePicker): New DatePicker component#3283

Draft
aresnik11 wants to merge 24 commits intomainfrom
ajr-datepicker-styles
Draft

feat(DatePicker): New DatePicker component#3283
aresnik11 wants to merge 24 commits intomainfrom
ajr-datepicker-styles

Conversation

@aresnik11
Copy link
Contributor

@aresnik11 aresnik11 commented Mar 13, 2026

Overview

WIP of the new DatePicker component. Looking for some early feedback, comments, questions, concerns. I left some comments in the code of things I'm questioning.

Things I know are missing/not completely working:

  • calendar quick actions
  • input validation when typing in a date
  • locale sort of works but needs more + translation for hardcoded text
  • tests

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: GMT-1520
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

Don't make me tap the sign.

  1. Go to story X
  2. Do something
  3. Do that something in dark mode
  4. Check it with VO
  5. Finish and do a celebratory dance

PR Links and Envs

Repository PR Link
Monolith Monolith PR
Mono Mono PR

@nx-cloud
Copy link

nx-cloud bot commented Mar 13, 2026

View your CI Pipeline Execution ↗ for commit a19fc7b


☁️ Nx Cloud last updated this comment at 2026-03-17 15:03:19 UTC

@codecov
Copy link

codecov bot commented Mar 13, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
811 1 810 0
View the top 1 failed test(s) by shortest run time
 Gamut Exported Keys
Stack Traces | 0.004s run time
Error: expect(received).toMatchSnapshot()

Snapshot name: `Gamut Exported Keys 1`

- Snapshot  - 1
+ Received  + 0

@@ -14,11 +14,10 @@
    "CalendarBody",
    "CalendarFooter",
    "CalendarHeader",
    "Card",
    "Checkbox",
-   "clampToMonth",
    "Coachmark",
    "Column",
    "ConnectedCheckbox",
    "ConnectedForm",
    "ConnectedFormGroup",
    at Object.<anonymous> (.../gamut/__tests__/gamut.test.ts:7:25)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../jest-circus/build/run.js:316:40)
    at async _runTest (.../jest-circus/build/run.js:252:3)
    at async _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at async run (.../jest-circus/build/run.js:71:3)
    at async runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at async jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at async runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at async runTest (.../jest-runner/build/runTest.js:444:34)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@aresnik11 aresnik11 changed the base branch from ajr-datepicker-range to main March 16, 2026 15:13
@aresnik11 aresnik11 changed the title Ajr datepicker styles feat(DatePicker): New DatePicker component Mar 16, 2026
@aresnik11 aresnik11 mentioned this pull request Mar 16, 2026
6 tasks
Copy link
Contributor

@dreamwasp dreamwasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image this is the default, i noticed when i navigated dates in the Calendar story the second month doesn't change (it stays March the whole time)

Image

the DatePicker itself looks way better and i like the simplicity of 'useDatePicker' hook. these are just my first thoughts, i'll take a deeper look at accessibility + structure later today!

Comment on lines +62 to +68
// Pad end of last week with nulls
if (currentWeek.length > 0) {
while (currentWeek.length < DAYS_PER_WEEK) {
currentWeek.push(null);
}
weeks.push(currentWeek);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these null returns for? days left over at the end of the month?

return disabledDates.some((d) => isSameDay(date, d));
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't really understand what this means - clamp?

boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
width: 'max-content',
})
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i found this confusing since this just a wrapper and DatePickerCalendar is the actual calendar

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this can be prettier. DatePickerCalendar is for DatePicker, but in theory the inside calendar parts could be used on their own

@aresnik11
Copy link
Contributor Author

Image this is the default, i noticed when i navigated dates in the Calendar story the second month doesn't change (it stays March the whole time)

Image the DatePicker itself looks way better and i like the simplicity of 'useDatePicker' hook. these are just my first thoughts, i'll take a deeper look at accessibility + structure later today!

@dreamwasp lol Calendar is only supposed to show the one month, the header clearly needs some work. thanks for the callout!

@codecademydev
Copy link
Collaborator

📬 Published Alpha Packages:

@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]

@github-actions
Copy link
Contributor

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.

3 participants