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

Add custom week day format #650

Merged
merged 1 commit into from
Sep 7, 2017
Merged

Add custom week day format #650

merged 1 commit into from
Sep 7, 2017

Conversation

schaable
Copy link
Contributor

Add a prop to customize the day format in the header.

Resolves #453 and #132

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.243% when pulling 5d09c42 on schaable:weekDayFormat into 83d55bf on airbnb:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.473% when pulling b139b10 on schaable:weekDayFormat into d12633f on airbnb:master.

@ljharb
Copy link
Member

ljharb commented Aug 9, 2017

Would you mind rebasing this on the command line so there's no merge commit?

@schaable
Copy link
Contributor Author

Done!

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.473% when pulling 2905096 on schaable:weekDayFormat into 9685cc9 on airbnb:master.

@jseminck
Copy link

jseminck commented Aug 23, 2017

I would like the same functionality, but I think it's more consistent to provide a render() function property, rather than just specifying the format. The same idea already applies for renderDay and renderMonth.

I have a branch in my fork that implements a renderWeekHeaderDay() prop. Please have a look and let me know what you think: jseminck@494117b

majapw
majapw previously approved these changes Sep 6, 2017
Copy link
Collaborator

@majapw majapw left a comment

Choose a reason for hiding this comment

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

LGTM

ljharb
ljharb previously approved these changes Sep 6, 2017
@@ -130,6 +130,7 @@ isDayHighlighted: PropTypes.func,
// internationalization props
displayFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
monthFormat: PropTypes.string,
weekDayFormat: PropTypes.string,
Copy link
Member

Choose a reason for hiding this comment

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

Is there a moment proptype we could use for "valid format"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically I think any string is a valid format (you can include arbitrary strings by surrounding them with brackets)

@ljharb ljharb added the semver-minor: new stuff Any feature or API addition. label Sep 6, 2017
@majapw majapw dismissed stale reviews from ljharb and themself via 35f6170 September 6, 2017 18:40
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.49% when pulling 35f6170 on schaable:weekDayFormat into d0996af on airbnb:master.

@majapw majapw merged commit e78f01e into react-dates:master Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor: new stuff Any feature or API addition.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants