Skip to content

CalendarMonth accepts customizable week and month names as props#136

Open
procidac wants to merge 2 commits into
onefinestay:masterfrom
procidac:master
Open

CalendarMonth accepts customizable week and month names as props#136
procidac wants to merge 2 commits into
onefinestay:masterfrom
procidac:master

Conversation

@procidac

@procidac procidac commented May 5, 2016

Copy link
Copy Markdown

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
Copy Markdown
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