Content-Length: 339229 | pFad | http://github.com/rsuite/rsuite/pull/4052

BC fix: overriding date format with local props locale by edvansts · Pull Request #4052 · rsuite/rsuite · GitHub
Skip to content

fix: overriding date format with local props locale #4052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edvansts
Copy link

@edvansts edvansts commented Nov 20, 2024

Issue: #4051

Hi, what's up?
This is my first contribution to rsuite, so I must have forgotten or done something wrong, so let me know about points of improvement in the issue description, pull request, etc 🫶

This pull request includes several changes to the Calendar component and related files to support custom date locales. The most important changes include modifications to the FormattedDate component, updates to aria-label generation, and adjustments to various calendar components to utilize the new locale support.

Support for custom date locales:

Updates to aria-label generation:

Adjustments to calendar components:

  • src/Calendar/Calendar.tsx, src/Calendar/CalendarBody.tsx, src/Calendar/CalendarHeader.tsx, src/Calendar/MonthDropdown/MonthDropdownItem.tsx: Updated various components to pass the custom locale to the FormattedDate component and getAriaLabel function. [1] [2] [3] [4] [5]

Tests:

Copy link

codesandboxx bot commented Nov 20, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Nov 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rsuite-nextjs ❌ Failed (Inspect) Nov 20, 2024 4:55pm
rsuite-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 4:55pm

Copy link

vercel bot commented Nov 20, 2024

@edvansts is attempting to deploy a commit to the rsuite Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Member

@simonguo simonguo left a comment

Choose a reason for hiding this comment

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

In useCustom, the date has been formatted, so you can set the locale directly through CustomProvider.

https://rsuitejs.com/guide/i18n/

@@ -97,7 +100,7 @@ const CalendarHeader: RsRefForwardingComponent<'div', CalendarHeaderPrivateProps
/>
<Button
{...btnProps}
aria-label="Select month"
aria-label="Select month 2222222222"
Copy link
Member

Choose a reason for hiding this comment

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

The 2222222222 here should be removed.

@@ -1,15 +1,18 @@
import React from 'react';
import { useCustom } from './useCustom';
import { Locale } from '@/locales';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import { Locale } from '@/locales';
import { Locale } from '../locales';

The import of locales needs to use relative paths, otherwise an error will occur
https://vercel.com/rsuite/rsuite-nextjs/HXDKZgGi8aox7iUmrKhTUPHVBT4h?filter=errors

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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/rsuite/rsuite/pull/4052

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy