Skip to content

Commit aeff02f

Browse files
计划时间改为当地时间
1 parent d0a91d6 commit aeff02f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/dashboard/Data/Jobs/JobEdit.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class JobEdit extends React.Component {
3333
schedule.job_schedule.jobName = changes.job;
3434
}
3535
if (!changes.immediate && changes.runAt) {
36-
schedule.job_schedule.startAfter = changes.runAt.toISOString();
36+
schedule.job_schedule.startAfter = changes.runAt.toLocaleDateString();
3737
}
3838
if (changes.repeat) {
3939
let hour = changes.repeatStartHour;

src/dashboard/Data/Jobs/Jobs.react.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import subscribeTo from 'lib/subscribeTo';
2525
import TableHeader from 'components/Table/TableHeader.react';
2626
import TableView from 'dashboard/TableView.react';
2727
import Toolbar from 'components/Toolbar/Toolbar.react';
28+
import {string} from "prop-types";
2829

2930
let subsections = {
3031
all: 'All Jobs',
@@ -48,7 +49,12 @@ function scheduleString(data) {
4849
} else {
4950
schedule += 'Each day, every ' + data.repeatMinutes + ' minutes, ';
5051
}
51-
schedule += 'after ' + data.timeOfDay.substr(0, 5) + ', ';
52+
let times = data.timeOfDay.split(':')
53+
let hour=times[0]
54+
hour=parseInt(hour)+8
55+
let timeOfDay=hour+":"+times[1]
56+
//schedule += 'after ' + data.timeOfDay.substr(0, 5) + ', ';
57+
schedule += 'after ' + timeOfDay + ', ';
5258
schedule += 'starting ';
5359
} else {
5460
schedule = 'On ';

src/lib/stores/JobsStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function JobsStore(state, action) {
3737
return Parse._request('POST', path, action.schedule, {useMasterKey: true}).then((result) => {
3838
let { ...schedule } = action.schedule.job_schedule;
3939
schedule.objectId = result.objectId;
40-
schedule.startAfter = schedule.startAfter || new Date().toISOString();
40+
schedule.startAfter = schedule.startAfter || new Date().toLocaleDateString();
4141
return state.set('jobs', state.get('jobs').push(schedule));
4242
});
4343
case ActionTypes.EDIT:

0 commit comments

Comments
 (0)