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

CalendarMonth accepts customizable week and month names as props #136

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

procidac
Copy link

@procidac procidac commented May 5, 2016

Hi @AlanFoster @AndrewIngram,

I'd like to contribute a backwards compatible improvement to react-daterange-picker that allows consumers to override the default labels for month and weekday names.

A consumer would pass the custom labels as props as follows:

const lang = moment().localeData();
const MONTHS = Immutable.List(moment.monthsShort());
const WEEKDAYS = Immutable
        .List(lang._weekdays)
        .zip(Immutable.List(moment.weekdaysMin().map(name => name.substring(0, 1))));
return (
  <DateRangePicker
        monthNames={MONTHS}
        weekdayNames={WEEKDAYS} />
);

The default labels would be used if props are not set. The two new props are independent and can be set separately.

@procidac
Copy link
Author

Hi @AlanFoster I would appreciate if you could look into this proposed improvement, thanks!

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.

1 participant