diff --git a/dist/react-bootstrap-datetimepicker.js b/dist/react-bootstrap-datetimepicker.js index 1b637a1d..652d8ab3 100644 --- a/dist/react-bootstrap-datetimepicker.js +++ b/dist/react-bootstrap-datetimepicker.js @@ -7459,11 +7459,6 @@ return /******/ (function(modules) { // webpackBootstrap _react2.default.createElement( "tr", { styleName: "day-of-week" }, - _react2.default.createElement( - "th", - null, - "Su" - ), _react2.default.createElement( "th", null, @@ -7493,6 +7488,11 @@ return /******/ (function(modules) { // webpackBootstrap "th", null, "Sa" + ), + _react2.default.createElement( + "th", + null, + "Su" ) ) ), @@ -7540,12 +7540,13 @@ return /******/ (function(modules) { // webpackBootstrap month = _this2.props.viewDate.month(); prevMonth = _this2.props.viewDate.clone().subtract(1, "months"); days = prevMonth.daysInMonth(); - prevMonth.date(days).startOf("week"); + prevMonth.date(days).startOf("isoweek"); nextMonth = (0, _moment2.default)(prevMonth).clone().add(42, "d"); minDate = _this2.props.minDate ? _this2.props.minDate.clone().subtract(1, "days") : _this2.props.minDate; maxDate = _this2.props.maxDate ? _this2.props.maxDate.clone() : _this2.props.maxDate; html = []; cells = []; + while (prevMonth.isBefore(nextMonth)) { var classes = { day: true @@ -7585,7 +7586,7 @@ return /******/ (function(modules) { // webpackBootstrap onClick: _this2.handleDateClick.bind(_this2, !!classes.disabled) }, prevMonth.date() )); - if (prevMonth.weekday() === (0, _moment2.default)().endOf("week").weekday()) { + if (prevMonth.weekday() === (0, _moment2.default)().endOf("isoweek").weekday()) { row = _react2.default.createElement( "tr", { key: prevMonth.month() + "-" + prevMonth.date() }, diff --git a/package.json b/package.json index 0b5f6627..761333de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@testlio/react-bootstrap-datetimepicker", - "version": "0.3.0", + "version": "0.4.0", "description": "A bootstrap datetime picker component for React.js", "homepage": "http://dev.quri.com/react-bootstrap-datetimepicker/", "repository": { diff --git a/src/components/DateTimePickerDays.js b/src/components/DateTimePickerDays.js index 58b46c0f..f09874e7 100644 --- a/src/components/DateTimePickerDays.js +++ b/src/components/DateTimePickerDays.js @@ -4,7 +4,7 @@ import classnames from "classnames"; import styles from '../css/date-time-picker-days.css'; import CSSModules from 'react-css-modules'; import NextPrevChanger from './next-prev-changer/next-prev-changer.js' - + @CSSModules(styles, { allowMultiple: true }) export default class DateTimePickerDays extends Component { static propTypes = { @@ -35,12 +35,13 @@ export default class DateTimePickerDays extends Component { month = this.props.viewDate.month(); prevMonth = this.props.viewDate.clone().subtract(1, "months"); days = prevMonth.daysInMonth(); - prevMonth.date(days).startOf("week"); + prevMonth.date(days).startOf("isoweek"); nextMonth = moment(prevMonth).clone().add(42, "d"); minDate = this.props.minDate ? this.props.minDate.clone().subtract(1, "days") : this.props.minDate; maxDate = this.props.maxDate ? this.props.maxDate.clone() : this.props.maxDate; html = []; cells = []; + while (prevMonth.isBefore(nextMonth)) { let classes = { day: true @@ -73,12 +74,12 @@ export default class DateTimePickerDays extends Component { } cells.push( -