-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added support for defining a date format. #48
Conversation
Great work, did you notice that there's another pull request that implements custom date formatting? That one is almost finished, but blocked on a problem where the highlighting doesn't work anymore while incrementing/decrementing the date (#46 (comment)) |
Oh I didn't see that 😄 Ok I close this pull request and wait for the other one. |
Thanks for taking the time to send in this pull request. As you might have noticed, #46 has gone stale. If you could come up with a fix for my concerns in this Pull Request, I'd be happy to merge it! (I would suggest removing the arrow-up/arrow-down functionality). |
support it for arbitrary date formats.
Ok cool. I've removed the arrow-up/arrow-down functionality from date_input.js (but not the corresponding helper stuff in DateUtil yet). |
@@ -107,9 +107,13 @@ module.exports = Calendar; | |||
var DateUtil = require('./util/date'); | |||
|
|||
var DateInput = React.createClass({displayName: 'DateInput', | |||
getDateFormat: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to move this to getDefaultProps (http://facebook.github.io/react/docs/reusable-components.html#default-prop-values)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getDefaultProps: function() {
return {
dateFormat: 'YYYY-MM-DD'
};
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martijnrusschen thanks, I wasn't aware of React's getDefaultProp. Change is done in 22eb832
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you compile the new JS? This should be removed right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I compiled it, but I forgot to include it in the commit. Added in 564d11e
Added support for defining a date format.
Hi,
thanks for creating this nice React component. I've added support for defining a custom date format.
Best regards
Max