import React from 'react'; import PropTypes from 'prop-types'; import moment from 'moment'; import {chunk} from 'lodash'; import {Button} from '../../'; import './style.scss'; import {getMonthNames} from 'core/helpers/locale'; /** * @ngdoc react * @name MonthPicker * @description Component to Pick months of DatePicker */ export const MonthPicker: React.StatelessComponent = ({selectedDate, onChange}) => { const monthNames = getMonthNames(moment.locale()); const rows = chunk(monthNames, 3); return ( {rows.map((row, rowIndex) => ( {row.map((date, index) => ( ))} ))}
); }; MonthPicker.propTypes = { selectedDate: PropTypes.object.isRequired, onChange: PropTypes.func.isRequired, };