diff --git a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js index 3ef957042..9f9cae4e1 100644 --- a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js +++ b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js @@ -51,22 +51,21 @@ class OneSelfOrderModal extends Component{ let course_groups = this.props.course_groups; course_groups.map((item, key) => { - console.log(item) + if (item.end_time === null) { // if(this.props.starttimesend===undefined){ // item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); // }else{ // item.end_time = moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm"); // } - item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); - newarr.push(item) - } else { if(this.props.starttimesend){ item.end_time = moment(moment(handleDateString(this.props.starttimesend))).format("YYYY-MM-DD HH:mm"); }else{ item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); } newarr.push(item) + } else { + newarr.push(item) } }) this.setState({ @@ -109,15 +108,14 @@ class OneSelfOrderModal extends Component{ course_groups.map((item,key)=>{ if(item.end_time===null){ // item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); - item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); - newarr.push(item) - }else{ if(this.props.starttimesend){ item.end_time = moment(moment(handleDateString(this.props.starttimesend))).format("YYYY-MM-DD HH:mm"); }else{ item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); } newarr.push(item) + }else{ + newarr.push(item) } }) this.setState({