moveNext() movePrevious() moves now to day 1 to prevent a month jump
gitea/salix/test This commit looks good
Details
gitea/salix/test This commit looks good
Details
This commit is contained in:
parent
97459bd7e6
commit
5abb82faab
|
@ -225,6 +225,7 @@ export default class Calendar extends Component {
|
|||
*/
|
||||
moveNext(skip = 1) {
|
||||
let next = this.defaultDate.getMonth() + skip;
|
||||
this.defaultDate.setDate(1);
|
||||
this.defaultDate.setMonth(next);
|
||||
this.repaint();
|
||||
|
||||
|
@ -238,6 +239,7 @@ export default class Calendar extends Component {
|
|||
*/
|
||||
movePrevious(skip = 1) {
|
||||
let previous = this.defaultDate.getMonth() - skip;
|
||||
this.defaultDate.setDate(1);
|
||||
this.defaultDate.setMonth(previous);
|
||||
this.repaint();
|
||||
|
||||
|
|
|
@ -98,8 +98,8 @@ class Controller {
|
|||
for (let i = 0; i < months.length; i++) {
|
||||
const now = new Date();
|
||||
now.setHours(0, 0, 0, 0);
|
||||
now.setMonth(i);
|
||||
now.setDate(1);
|
||||
now.setMonth(i);
|
||||
|
||||
months[i] = now;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue