Skip to content

Add skeleton support to existing date/time functions - #396

Open
bearfriend wants to merge 5 commits into
mainfrom
dgleckler/format-date-skeleton
Open

Add skeleton support to existing date/time functions#396
bearfriend wants to merge 5 commits into
mainfrom
dgleckler/format-date-skeleton

Conversation

@bearfriend

@bearfriend bearfriend commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

GAUD-10218: Update intl dateTime functions to accept and render from skeleton patterns

For now, we only call formatDateTimeSkeleton when the skeleton option is explicitly set. Down the road we can start to transition more calls/options to use/convert to skeletons and slowly get rid of the existing custom format handling.

@bearfriend
bearfriend requested a review from a team as a code owner July 28, 2026 20:59
Comment thread lib/dateTimeSkeleton.js Outdated
Comment thread test/dateTime.test.js Outdated
Comment thread test/dateTime.test.js
const date = new Date(2021, 3, 15, 14, 30);
let skeleton = 'MMMM';
let result = formatDateTimeSkeleton(date, { skeleton, forceUnsupportedFormat: true });
expect(result).to.equal('abril');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bringing back nightmares...

Comment thread lib/dateTimeSkeleton.js
skeleton = '',
} = options;

if (!skeleton) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit confused, since I don't see how this branch would be reached unless someone called formatDateTimeSkeleton directly without going through formatDate or formatTime? Is the plan to switch everything to this eventually and then retire formatDate and formatTime?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep exactly. Definitely some future-looking stuff there.

bearfriend and others added 2 commits July 30, 2026 13:20
Co-authored-by: Dave Lockhart <5491151+dlockhart@users.noreply.github.com>
@bearfriend
bearfriend enabled auto-merge (squash) July 30, 2026 18:15
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.

2 participants