diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/BetweenEditor.js b/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/BetweenEditor.js index 0ec82f18a6f2c822ff6fba2e54b3a60a30f2499e..ec5b24ed6756b31d6aa4e7f9473df61add37183a 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/BetweenEditor.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/BetweenEditor.js @@ -132,7 +132,7 @@ render() { d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} value= {this.state.rowData[index].from} onChange= {e => {this.updateDateChanges(index, 'from', e)}} - onBlur= {e => {this.updateDateChanges(index, 'from', e)}} + // onBlur= {e => {this.updateDateChanges(index, 'from', e)}} showTime={true} showSeconds={true} hourFormat="24" @@ -142,7 +142,7 @@ render() { d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} value= {this.state.rowData[index].until} onChange= {e => {this.updateDateChanges(index, 'until', e)}} - // onBlur= {e => {this.updateDateChanges(index, 'until', e)}} + // onBlur= {e => {this.updateDateChanges(index, 'until', e)}} showTime={true} showSeconds={true} hourFormat="24" diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/Timeline/CalendarTimeline.js b/SAS/TMSS/frontend/tmss_webapp/src/components/Timeline/CalendarTimeline.js index 28b3e5b943ee5549f0c4d445342aec42eb5ab179..1cfe8d1f035db4b05c36c4ff488f98c17c2051f4 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/Timeline/CalendarTimeline.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/Timeline/CalendarTimeline.js @@ -169,10 +169,6 @@ export class CalendarTimeline extends Component { return true; } - componentDidUpdate() { - // console.log("Component Updated"); - } - /** * Sets current UTC and LST time either from the server or locally. * @param {boolean} systemClock - to differetiate whether tosync with server or local update @@ -1290,7 +1286,7 @@ export class CalendarTimeline extends Component { {this.state.allowDateSelection && <> {/* <span className="p-float-label"> */} - <Calendar id="range" placeholder="Select Date Range" selectionMode="range" dateFormat="yy/mm/dd" showIcon={!this.state.zoomRange} + <Calendar id="range" placeholder="Select Date Range" selectionMode="range" dateFormat="yy-mm-dd" showIcon={!this.state.zoomRange} value={this.state.zoomRange} onChange={(e) => this.setZoomRange( e.value )} readOnlyInput /> {/* <label htmlFor="range">Select Date Range</label> </span> */} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js index 236776f62e44a90e6acaf010b8f64507f5d7bfc3..44ec021de1b0b9a9aba294cb1b8e85ea954addda 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js @@ -282,7 +282,7 @@ function CalendarColumnFilter({ return ( <div className="table-filter" onClick={e => { e.stopPropagation() }}> - <Calendar value={value} appendTo={document.body} dateFormat="yy/mm/dd" onChange={(e) => { + <Calendar value={value} appendTo={document.body} dateFormat="yy-mm-dd" onChange={(e) => { const value = moment(e.value).format('YYYY-MM-DD') setValue(value); setFilter(value); }} showIcon></Calendar> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js index 140477f2a3d192069473b54e3c43808c75228d75..a6323fc35053a8bc66c234bd6305c02a7b2548c0 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js @@ -247,22 +247,29 @@ export class CycleCreate extends Component { } this.setState({errors: errors, validFields: validFields}); - if (Object.keys(validFields).length === Object.keys(this.formRules).length) { - validForm = true; - } + // if (Object.keys(validFields).length === Object.keys(this.formRules).length) { + // validForm = true; + // } if(this.state.cycle['start'] && this.state.cycle['stop']){ var isSameOrAfter = moment(this.state.cycle['stop']).isSameOrAfter(this.state.cycle['start']); if(!isSameOrAfter){ errors['stop'] = ` Stop date can not be before Start date`; - validForm = false; - }else{ + validForm = false; + return validForm; + }else{ + delete errors['stop']; + validForm = true; + } + if (Object.keys(validFields).length === Object.keys(this.formRules).length) { validForm = true; + } else { + validForm = false } } return validForm; } - + /** * Function to call when 'Save' button is clicked to save the Cycle. */ diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/list.js index a29788f620e43c4b59ac4cc1b773b68bfeb1bc15..ac81b969c4f2c2a45696aaaba4424c2b3a29294d 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/list.js @@ -2,7 +2,6 @@ import React, { Component } from 'react' import 'primeflex/primeflex.css'; // import { Link } from 'react-router-dom/cjs/react-router-dom.min'; import _ from 'lodash'; -import moment from 'moment'; import ViewTable from '../../components/ViewTable'; import CycleService from '../../services/cycle.service'; import UnitConversion from '../../utils/unit.converter'; @@ -114,15 +113,6 @@ class CycleList extends Component{ cycle.id = cycle.name ; cycle.regularProjects = regularProjects.length; cycle.longterm = longterm.length; - // cycle.start = moment(cycle['start'], moment.ISO_8601).format(UIConstants.CALENDAR_DEFAULTDATE_FORMAT); - // cycle.stop = moment(cycle['stop'], moment.ISO_8601).format(UIConstants.CALENDAR_DEFAULTDATE_FORMAT); - // cycle.observingTime = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'observing_time'); - // cycle.processingTime = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'cep_processing_time'); - // cycle.ltaResources = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'lta_storage'); - // cycle.support = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'support_time'); - // cycle.observingTimeDDT = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'observing_time_commissioning'); - // cycle.observingTimePrioA = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'observing_time_prio_a'); - // cycle.observingTimePrioB = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'observing_time_prio_b'); cycle.observingTime = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'LOFAR Observing Time'); cycle.processingTime = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'CEP Processing Time'); cycle.ltaResources = this.getUnitConvertedQuotaValue(cycle, cycleQuota, 'LTA Storage'); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js index 4082a21e23fea4eb2ab60af19967624ba37bde00..f7fd4e625839f6f5ea67f4317a2037b3394f70a8 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js @@ -30,10 +30,12 @@ class SchedulingUnitList extends Component{ name:"Name", start_time:{ name:"Start Time", + filter:"date", format:UIConstants.CALENDAR_DATETIME_FORMAT }, stop_time:{ name:"End time", + filter:"date", format:UIConstants.CALENDAR_DATETIME_FORMAT }, duration:{ diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js index 5d0bd69e1cfe7f179999213b1d04900fcaa29764..2932b01a705b35428eaedcd91325af3aa2eed1e1 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js @@ -355,7 +355,7 @@ export class ReservationCreate extends Component { <label htmlFor="reservationName" className="col-lg-2 col-md-2 col-sm-12">From Date <span style={{color:'red'}}>*</span></label> <div className="col-lg-3 col-md-3 col-sm-12"> <Calendar - d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} + d dateFormat="yy-mm-dd" value= {this.state.reservation.start_time} onChange= {e => this.setParams('start_time',e.value)} data-testid="start_time" diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js index cf5ced1fdc96c2b63f2db01f1ceba52248021403..7967bd1fa8f833e81b989653f2c0755f0e480f89 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js @@ -849,7 +849,15 @@ export class TimelineView extends Component { <ViewTable data={this.state.suBlueprintList} defaultcolumns={[{name: "Name", - start_time:"Start Time", stop_time:"End Time"}]} + start_time: + { + name:"Start Time", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + stop_time:{ + name:"End Time", + format:UIConstants.CALENDAR_DATETIME_FORMAT} + }]} optionalcolumns={[{project:"Project",description: "Description", duration:"Duration (HH:mm:ss)", actionpath: "actionpath"}]} columnclassname={[{"Start Time":"filter-input-50", "End Time":"filter-input-50", "Duration (HH:mm:ss)" : "filter-input-50",}]}