File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 5
5
* This source code is licensed under the license found in the LICENSE file in
6
6
* the root directory of this source tree.
7
7
*/
8
- import PropTypes from 'lib/PropTypes' ;
8
+ import PropTypes from 'lib/PropTypes' ;
9
9
import { ActionTypes } from 'lib/stores/JobsStore' ;
10
10
import history from 'dashboard/history' ;
11
11
import JobsForm from 'dashboard/Data/Jobs/JobsForm.react' ;
@@ -37,10 +37,16 @@ class JobEdit extends React.Component {
37
37
}
38
38
if ( changes . repeat ) {
39
39
let hour = changes . repeatStartHour ;
40
- if ( hour . length < 2 ) {
41
- hour = '0' + hour ;
40
+ var subHour = 0
41
+ if ( hour < 8 ) {
42
+ subHour = hour - 8 + 24
43
+ } else {
44
+ subHour = hour - 8
42
45
}
43
- schedule . job_schedule . timeOfDay = `${ hour } :${ changes . repeatStartMinute } :00.000Z` ;
46
+ if ( subHour . length < 2 ) {
47
+ subHour = '0' + hour ;
48
+ }
49
+ schedule . job_schedule . timeOfDay = `${ subHour } :${ changes . repeatStartMinute } :00.000Z` ;
44
50
let interval = 0 ;
45
51
if ( changes . repeatType === 'daily' ) {
46
52
interval = 1440 ;
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ export default class JobsForm extends DashboardView {
40
40
}
41
41
if ( ! this . props . initialFields . repeatStartHour ) {
42
42
changes . repeatStartHour = '12' ;
43
+ } else {
44
+ if ( parseInt ( this . props . initialFields . repeatStartHour ) > 15 ) {
45
+ changes . repeatStartHour = ( parseInt ( this . props . initialFields . repeatStartHour ) + 8 - 24 ) . toString ( )
46
+ } else {
47
+ this . props . initialFields . repeatStartHour = ( parseInt ( this . props . initialFields . repeatStartHour ) + 8 ) . toString ( )
48
+ }
43
49
}
44
50
if ( ! this . props . initialFields . repeatStartMinute ) {
45
51
changes . repeatStartHour = '00' ;
You can’t perform that action at this time.
0 commit comments