Skip to content
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

feat(timerange): custom weekday labels for TimeRange #2510

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

Conversation

kaivola
Copy link

@kaivola kaivola commented Feb 6, 2024

Adds support for changing time range's weekday labels for localization or other purposes.
Addresses #1979 and #1822

Changes

Adds new prop weekdays: string[] to TimeRange component. The weekdays array should contain labels for the weekdays starting from sunday.

Example

TimeRange with Finnish labels

<ResponsiveTimeRange
    data={data}
    monthLegend={(_y, _m, date) => months[date.getMonth()]}
    firstWeekday={"sunday"}
    weekdayTicks={[0, 2, 4]}
    weekdays={['Sunnuntai', 'Maanantai', 'Tiistai', 'Keskiviikko', 'Torstai', 'Perjantai', 'Lauantai']}
/>

Screenshot_20240206_202146

Copy link

vercel bot commented Feb 6, 2024

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

Name Status Preview Comments Updated (UTC)
nivo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2024 6:35pm

@kaivola kaivola changed the title feat(timerange) custom weekday labels for timerange feat(timerange): custom weekday labels for timerange Feb 6, 2024
@kaivola kaivola changed the title feat(timerange): custom weekday labels for timerange feat(timerange): custom weekday labels for TimeRange Feb 6, 2024
Copy link

codesandbox-ci bot commented Feb 6, 2024

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.

Latest deployment of this branch, based on commit 43181cc:

Sandbox Source
nivo Configuration

@kaivola
Copy link
Author

kaivola commented Jun 6, 2024

@plouc
Any thoughts about this?

@dmitov
Copy link

dmitov commented Sep 13, 2024

bump

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