Commit 955f14ee authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/bww-v1'

parents 58f92ed7 17a6b335
......@@ -7,7 +7,7 @@ import {
LocalStorage,
SessionStorage,
isExpired,
getRandomFilename,
getRandomFilename, formatMonth,
} from '../utils/index';
import { calendar } from '../utils/calendar';
import * as classMgtAjax from '../services/classmgt';
......@@ -141,12 +141,16 @@ export default {
const { type } = payload;
const { currentTimestamp, judgetodaycurrentTimestamp } = yield select(state => state.plancourse);
let newcurrentTimestamp = currentTimestamp;
const d = formatMonth(newcurrentTimestamp / 1000).split('-');
const year = d[0];
const month = d[1];
const monthDays = new Date(d[0], d[1], 0).getDate();
if (type == 'preyear') {
newcurrentTimestamp -= (365 * 24 * 60 * 60 * 1000);
} else if (type == 'premonth') {
newcurrentTimestamp -= (31 * 24 * 60 * 60 * 1000);
newcurrentTimestamp = new Date(year, month - 1, 1).getTime() - 1;
} else if (type == 'nextmonth') {
newcurrentTimestamp += (31 * 24 * 60 * 60 * 1000);
newcurrentTimestamp = new Date(year, month - 1, monthDays).getTime() + (24 * 60 * 60 * 1000) + 1;
} else if (type == 'nextyear') {
newcurrentTimestamp += (365 * 24 * 60 * 60 * 1000);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment