diff --git a/README.md b/README.md index 35dd31a..483a852 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ A fast, intuitive, and elegant date and time picker for React. - `settings` - *object* : properties to override as an object (default: `{ week: { dow: 1 }, weekdaysMin: ['M', 'T', 'W', 'T', 'F', 'S', 'S'] }`) - `format`: - *object* : Moment formatting for cell titles - `today`: - *string* : default: `Today` + - `hideToday`: - *boolean* : default: `false` - `year`: - *string* : default: `YYYY` - `month`: - *string* : default: `MMM` - `day`: - *string* : default: `D` diff --git a/src/calendar.js b/src/calendar.js index 23ee965..c02973e 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -324,7 +324,7 @@ class Calendar extends Component { ) }) .filter(cell => cell != null)} - {level != 'hours' && + {level != 'hours' && !get(this.props, 'options.format.hideToday') &&
{get(this.props, 'options.format.today') || 'Today'}
} diff --git a/src/index.js b/src/index.js index be0f66c..f39bc63 100644 --- a/src/index.js +++ b/src/index.js @@ -69,7 +69,8 @@ class Kronos extends Component { settings: PropTypes.object, }), format: PropTypes.shape({ - today: PropTypes.string, + hideToday: PropTypes.bool, + today: PropTypes.oneOfType([PropTypes.string, PropTypes.element]), year: PropTypes.string, month: PropTypes.string, day: PropTypes.string,