This commit is contained in:
parent
f752404ebe
commit
dd17bb0386
|
@ -260,9 +260,9 @@ export default class Calendar extends Component {
|
||||||
*/
|
*/
|
||||||
moveNext(skip = 1) {
|
moveNext(skip = 1) {
|
||||||
let next = this.defaultDate.getMonth() + skip;
|
let next = this.defaultDate.getMonth() + skip;
|
||||||
this.defaultDate.setMonth(next);
|
|
||||||
this.defaultDate.setHours(0, 0, 0, 0);
|
this.defaultDate.setHours(0, 0, 0, 0);
|
||||||
this.defaultDate.setDate(1);
|
this.defaultDate.setDate(1);
|
||||||
|
this.defaultDate.setMonth(next);
|
||||||
this.repaint();
|
this.repaint();
|
||||||
|
|
||||||
this.emit('moveNext');
|
this.emit('moveNext');
|
||||||
|
@ -275,11 +275,10 @@ export default class Calendar extends Component {
|
||||||
*/
|
*/
|
||||||
movePrevious(skip = 1) {
|
movePrevious(skip = 1) {
|
||||||
let previous = this.defaultDate.getMonth() - skip;
|
let previous = this.defaultDate.getMonth() - skip;
|
||||||
this.defaultDate.setMonth(previous);
|
|
||||||
this.defaultDate.setHours(0, 0, 0, 0);
|
this.defaultDate.setHours(0, 0, 0, 0);
|
||||||
|
this.defaultDate.setDate(1);
|
||||||
|
this.defaultDate.setMonth(previous);
|
||||||
|
|
||||||
const lastDate = this.lastDay(this.defaultDate);
|
|
||||||
this.defaultDate.setDate(lastDate.getDate());
|
|
||||||
this.repaint();
|
this.repaint();
|
||||||
|
|
||||||
this.emit('movePrevious');
|
this.emit('movePrevious');
|
||||||
|
|
|
@ -7,8 +7,11 @@ class Controller {
|
||||||
this.$scope = $scope;
|
this.$scope = $scope;
|
||||||
this.$http = $http;
|
this.$http = $http;
|
||||||
this.stMonthDate = new Date();
|
this.stMonthDate = new Date();
|
||||||
this.ndMonthDate = new Date();
|
const ndMonth = new Date();
|
||||||
this.ndMonthDate.setMonth(this.ndMonthDate.getMonth() + 1);
|
ndMonth.setDate(1);
|
||||||
|
ndMonth.setMonth(ndMonth.getMonth() + 1);
|
||||||
|
|
||||||
|
this.ndMonthDate = ndMonth;
|
||||||
}
|
}
|
||||||
|
|
||||||
$postLink() {
|
$postLink() {
|
||||||
|
|
Loading…
Reference in New Issue