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