moveNext() movePrevious() moves now to day 1 to prevent a month jump
gitea/salix/dev This commit has test failures
Details
gitea/salix/dev This commit has test failures
Details
This commit is contained in:
parent
5d8e9771d7
commit
68f67f12d7
|
@ -225,6 +225,7 @@ 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.setDate(1);
|
||||||
this.defaultDate.setMonth(next);
|
this.defaultDate.setMonth(next);
|
||||||
this.repaint();
|
this.repaint();
|
||||||
|
|
||||||
|
@ -238,6 +239,7 @@ 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.setDate(1);
|
||||||
this.defaultDate.setMonth(previous);
|
this.defaultDate.setMonth(previous);
|
||||||
this.repaint();
|
this.repaint();
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,8 @@ class Controller {
|
||||||
for (let i = 0; i < months.length; i++) {
|
for (let i = 0; i < months.length; i++) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
now.setHours(0, 0, 0, 0);
|
now.setHours(0, 0, 0, 0);
|
||||||
now.setMonth(i);
|
|
||||||
now.setDate(1);
|
now.setDate(1);
|
||||||
|
now.setMonth(i);
|
||||||
|
|
||||||
months[i] = now;
|
months[i] = now;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue