Skip to content

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