We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cd3a4b commit 0e6b771Copy full SHA for 0e6b771
1 file changed
src/Calendar.js
@@ -26,7 +26,16 @@ import mapValues from 'lodash/mapValues'
26
import { wrapAccessor } from './utils/accessors'
27
28
function viewNames(_views) {
29
- return !Array.isArray(_views) ? Object.keys(_views) : _views
+ if (Array.isArray(_views)) {
30
+ return _views
31
+ }
32
+ const views = []
33
+ for (const [key, value] of Object.entries(_views)) {
34
+ if (value) {
35
+ views.push(key)
36
37
38
+ return views
39
}
40
41
function isValidView(view, { views: _views }) {
@@ -47,7 +56,7 @@ class Calendar extends React.Component {
47
56
* const localizer = globalizeLocalizer(globalize)
48
57
* ```
49
58
* moment
50
- * ```js
59
+ * ``js
51
60
* import {momentLocalizer} from 'react-big-calendar'
52
61
* import moment from 'moment'
53
62
* // and, for optional time zone support
0 commit comments