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 f82de002593b6c8555798e5a41e9f1c778e060dc..ec5b24ed6756b31d6aa4e7f9473df61add37183a 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/BetweenEditor.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/BetweenEditor.js @@ -6,8 +6,9 @@ import { Button } from 'primereact/button'; import moment from 'moment'; import _ from 'lodash'; +import UIConstants from '../../utils/ui.constants'; -const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; +//const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; export default class BetweenEditor extends Component { constructor(props) { @@ -69,7 +70,7 @@ export default class BetweenEditor extends Component { let consolidateDates = ''; this.state.rowData.map(row =>{ if((row['from'] !== '' && row['from'] !== 'undefined') && (row['until'] !== '' && row['until'] !== 'undefined')){ - consolidateDates += ((row['from'] !== '')?moment(row['from']).format(DATE_TIME_FORMAT):'' )+","+((row['until'] !== '')?moment(row['until']).format(DATE_TIME_FORMAT):'')+"|"; + consolidateDates += ((row['from'] !== '')?moment(row['from']).format(UIConstants.CALENDAR_DATETIME_FORMAT):'' )+","+((row['until'] !== '')?moment(row['until']).format(UIConstants.CALENDAR_DATETIME_FORMAT):'')+"|"; } }); await this.props.context.componentParent.updateTime( @@ -128,20 +129,20 @@ render() { <React.Fragment key={index}> <div className="p-field p-grid" > <Calendar - d dateFormat="dd-M-yy" + 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" showIcon={true} /> <Calendar - d dateFormat="dd-M-yy" + 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/Spreadsheet/CustomDateComp.js b/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/CustomDateComp.js index 2622ec5b11ce2bddee7611769af0d913c2041ade..df3173ddfee900a2e2f339a1f3f7664a95fe6f74 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/CustomDateComp.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/CustomDateComp.js @@ -1,8 +1,9 @@ import React, { Component } from 'react'; import {Calendar} from 'primereact/calendar'; import moment from 'moment'; +import UIConstants from '../../utils/ui.constants'; -const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; +//const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; export default class CustomDateComp extends Component { constructor(props) { @@ -25,7 +26,7 @@ export default class CustomDateComp extends Component { } isCancelAfterEnd(){ - let date = (this.state.date !== '' && this.state.date !== 'undefined')? moment(this.state.date).format(DATE_TIME_FORMAT) :''; + let date = (this.state.date !== '' && this.state.date !== 'undefined')? moment(this.state.date).format(UIConstants.CALENDAR_DATETIME_FORMAT) :''; this.props.context.componentParent.updateTime( this.props.node.rowIndex,this.props.colDef.field, date ); @@ -34,7 +35,7 @@ export default class CustomDateComp extends Component { render() { return ( <Calendar - d dateFormat="dd-M-yy" + d dateFormat = {UIConstants.CALENDAR_DATE_FORMAT} value= {this.state.date} onChange= {e => {this.updateDateChanges(e)}} onBlur= {e => {this.updateDateChanges(e)}} 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 f0210bc1b3a0a2ab2931250232e34a2af1230f73..19ee68919a9d2397e8e4691152bc713246427d73 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/Timeline/CalendarTimeline.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/Timeline/CalendarTimeline.js @@ -94,7 +94,7 @@ export class CalendarTimeline extends Component { timeHeaderLabelVisibile: true, currentUTC: props.currentUTC || moment().utc(), // Current UTC for clock display currentLST: null, // Current LST for clock display - cursorLST: moment().format('HH:mm:ss'), // Holds the LST value for the cursot position in the timeline + cursorLST: moment().format(UIConstants.CALENDAR_TIME_FORMAT), // Holds the LST value for the cursot position in the timeline lastCursorPosition: null, // To track the last cursor position and fetch the data from server if changed utcLSTMap:{}, // JSON object to hold LST values fetched from server for UTC and show LST value in cursor label lstDateHeaderMap: {}, // JSON object to hold header value for the LST axis in required format like 'HH' or 'MM' or others @@ -170,10 +170,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 @@ -1218,7 +1214,7 @@ export class CalendarTimeline extends Component { } } - async changeWeek(direction) { + async changeWeek(direction) { this.setState({isWeekLoading: true}); let startDate = this.state.group[1].value.clone().add(direction * 7, 'days'); let endDate = this.state.group[this.state.group.length-1].value.clone().add(direction * 7, 'days').hours(23).minutes(59).seconds(59); @@ -1277,7 +1273,7 @@ export class CalendarTimeline extends Component { </div> {this.state.currentLST && <div style={{marginTop: "0px"}}> - <label style={{marginBottom: "0px"}}>LST:</label><span>{this.state.currentLST.format("HH:mm:ss")}</span> + <label style={{marginBottom: "0px"}}>LST:</label><span>{this.state.currentLST.format(UIConstants.CALENDAR_TIME_FORMAT)}</span> </div> } </div> @@ -1293,7 +1289,7 @@ export class CalendarTimeline extends Component { {this.state.allowDateSelection && <> {/* <span className="p-float-label"> */} - <Calendar id="range" placeholder="Select Date Range" selectionMode="range" 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 4198223b4b8a65addb32df2eef12fc42a1a3fa19..b0202b05cf33dda39dc34f4d273b4c9530976897 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js @@ -17,6 +17,7 @@ import { InputNumber } from "primereact/inputnumber"; import { MultiSelect } from 'primereact/multiselect'; import { RadioButton } from 'primereact/radiobutton'; import { useExportData } from "react-table-plugins"; +import UIConstants from '../utils/ui.constants'; import Papa from "papaparse"; import JsPDF from "jspdf"; import "jspdf-autotable"; @@ -281,9 +282,10 @@ function CalendarColumnFilter({ return ( <div className="table-filter" onClick={e => { e.stopPropagation() }}> - <Calendar value={value} appendTo={document.body} onChange={(e) => { - const value = moment(e.value, moment.ISO_8601).format("YYYY-MMM-DD") - setValue(value); setFilter(value); + <Calendar value={filterValue} appendTo={document.body} dateFormat="yy-mm-dd" onChange={(e) => { + const value = moment(e.value).format('YYYY-MM-DD') + setValue(value); + setFilter(e.value); }} showIcon></Calendar> {value && <i onClick={() => { setFilter(undefined); setValue('') }} className="tb-cal-reset fa fa-times" />} </div> @@ -304,8 +306,8 @@ function DateTimeColumnFilter({ return ( <div className="table-filter" onClick={e => { e.stopPropagation() }}> - <Calendar value={value} appendTo={document.body} onChange={(e) => { - const value = moment(e.value, moment.ISO_8601).format("YYYY-MMM-DD HH:mm:SS") + <Calendar value={value} appendTo={document.body} dateFormat="yy/mm/dd" onChange={(e) => { + const value = moment(e.value, moment.ISO_8601).format('YYYY-MM-DD HH:mm:ss') setValue(value); setFilter(value); }} showIcon // showTime= {true} @@ -333,9 +335,9 @@ function fromDatetimeFilterFn(rows, id, filterValue) { let rowValue = moment.utc(row.values[id].split('.')[0]); if (!rowValue.isValid()) { // For cell data in format 'YYYY-MMM-DD' - rowValue = moment.utc(moment(row.values[id], 'YYYY-MMM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); + rowValue = moment.utc(moment(row.values[id], 'YYYY-MM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); } - const start = moment.utc(moment(filterValue, 'YYYY-MMM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); + const start = moment.utc(moment(filterValue, 'YYYY-MM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); return (start.isSameOrBefore(rowValue)); }); @@ -389,7 +391,7 @@ function multiSelectFilterFn(rows, id, filterValue) { * @param {String} filterValue */ function toDatetimeFilterFn(rows, id, filterValue) { - let end = moment.utc(moment(filterValue, 'YYYY-MMM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); + let end = moment.utc(moment(filterValue, 'YYYY-MM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); end = moment(end, "DD-MM-YYYY").add(1, 'days'); const filteredRows = _.filter(rows, function (row) { // If cell value is null or empty @@ -400,7 +402,7 @@ function toDatetimeFilterFn(rows, id, filterValue) { let rowValue = moment.utc(row.values[id].split('.')[0]); if (!rowValue.isValid()) { // For cell data in format 'YYYY-MMM-DD' - rowValue = moment.utc(moment(row.values[id], 'YYYY-MMM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); + rowValue = moment.utc(moment(row.values[id], 'YYYY-MM-DDTHH:mm:SS').format("YYYY-MM-DDTHH:mm:SS")); } return (end.isSameOrAfter(rowValue)); }); @@ -423,10 +425,10 @@ function dateFilterFn(rows, id, filterValue) { let rowValue = moment.utc(row.values[id].split('.')[0]); if (!rowValue.isValid()) { // For cell data in format 'YYYY-MMM-DD' - rowValue = moment.utc(moment(row.values[id], 'YYYY-MMM-DD').format("YYYY-MM-DDT00:00:00")); + rowValue = moment.utc(moment(row.values[id], 'YYYY-MM-DD').format("YYYY-MM-DDT00:00:00")); } - const start = moment.utc(moment(filterValue, 'YYYY-MMM-DD').format("YYYY-MM-DDT00:00:00")); - const end = moment.utc(moment(filterValue, 'YYYY-MMM-DD').format("YYYY-MM-DDT23:59:59")); + const start = moment.utc(moment(filterValue, 'YYYY-MM-DD').format("YYYY-MM-DDT00:00:00")); + const end = moment.utc(moment(filterValue, 'YYYY-MM-DD').format("YYYY-MM-DDT23:59:59")); return (start.isSameOrBefore(rowValue) && end.isSameOrAfter(rowValue)); }); return filteredRows; @@ -666,7 +668,8 @@ function Table({ columns, data, defaultheader, optionalheader, tablename, defaul ); React.useEffect(() => { setHiddenColumns( - columns.filter(column => !column.isVisible).map(column => column.accessor) + // columns.filter(column => !column.isVisible).map(column => column.accessor) + columns.filter(column => !column.isVisible).map(column => column.id) ); // console.log('columns List', visibleColumns.map((d) => d.id)); if (columnOrders && columnOrders.length) { @@ -986,8 +989,8 @@ function ViewTable(props) { //Default Columns defaultdataheader.forEach(header => { const isString = typeof defaultheader[0][header] === 'string'; - const filterFn = (showColumnFilter ? (isString ? DefaultColumnFilter : (filterTypes[defaultheader[0][header].filter].fn ? filterTypes[defaultheader[0][header].filter].fn : DefaultColumnFilter)) : ""); - const filtertype = (showColumnFilter ? (!isString && filterTypes[defaultheader[0][header].filter].type) ? filterTypes[defaultheader[0][header].filter].type : 'fuzzyText' : ""); + const filterFn = (showColumnFilter ? (isString ? DefaultColumnFilter : (filterTypes[defaultheader[0][header].filter] && filterTypes[defaultheader[0][header].filter].fn ? filterTypes[defaultheader[0][header].filter].fn : DefaultColumnFilter)) : ""); + const filtertype = (showColumnFilter ? (!isString && filterTypes[defaultheader[0][header].filter] && filterTypes[defaultheader[0][header].filter].type) ? filterTypes[defaultheader[0][header].filter].type : 'fuzzyText' : ""); columns.push({ Header: isString ? defaultheader[0][header] : defaultheader[0][header].name, id: isString ? defaultheader[0][header] : defaultheader[0][header].name, @@ -998,23 +1001,23 @@ function ViewTable(props) { // filter: (showColumnFilter?((!isString && defaultheader[0][header].filter=== 'date') ? 'includes' : 'fuzzyText'):""), // Filter: (showColumnFilter?(isString ? DefaultColumnFilter : (filterTypes[defaultheader[0][header].filter] ? filterTypes[defaultheader[0][header].filter] : DefaultColumnFilter)):""), isVisible: true, - Cell: props => <div> {updatedCellvalue(header, props.value)} </div>, + Cell: props => <div> {updatedCellvalue(header, props.value, defaultheader[0][header])} </div>, }) }) //Optional Columns optionaldataheader.forEach(header => { const isString = typeof optionalheader[0][header] === 'string'; - const filterFn = (showColumnFilter ? (isString ? DefaultColumnFilter : (filterTypes[optionalheader[0][header].filter].fn ? filterTypes[optionalheader[0][header].filter].fn : DefaultColumnFilter)) : ""); - const filtertype = (showColumnFilter ? (!isString && filterTypes[optionalheader[0][header].filter].type) ? filterTypes[optionalheader[0][header].filter].type : 'fuzzyText' : ""); + const filterFn = (showColumnFilter ? (isString ? DefaultColumnFilter : (filterTypes[optionalheader[0][header].filter] && filterTypes[optionalheader[0][header].filter].fn ? filterTypes[optionalheader[0][header].filter].fn : DefaultColumnFilter)) : ""); + const filtertype = (showColumnFilter ? (!isString && filterTypes[optionalheader[0][header].filter]) ? (filterTypes[optionalheader[0][header].filter].type || filterTypes[optionalheader[0][header].filter]) : 'fuzzyText' : ""); columns.push({ Header: isString ? optionalheader[0][header] : optionalheader[0][header].name, id: isString ? header : optionalheader[0][header].name, - accessor: isString ? header : optionalheader[0][header].name, + accessor: header, filter: filtertype, Filter: filterFn, isVisible: false, - Cell: props => <div> {updatedCellvalue(header, props.value)} </div>, + Cell: props => <div> {updatedCellvalue(header, props.value, optionalheader[0][header])} </div>, }) }); @@ -1033,7 +1036,7 @@ function ViewTable(props) { });*/ } - function updatedCellvalue(key, value) { + function updatedCellvalue(key, value, properties) { try { if (key === 'blueprint_draft' && _.includes(value, '/task_draft/')) { // 'task_draft/' -> len = 12 @@ -1051,12 +1054,13 @@ function ViewTable(props) { return retval; } else if (typeof value == "boolean") { return value.toString(); - } else if (typeof value == "string") { - const dateval = moment(value, moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); + }else if (typeof value == "string") { + const format = properties ? properties.format : 'YYYY-MM-DD HH:mm:ss'; + const dateval = moment(value, moment.ISO_8601).format(format); if (dateval !== 'Invalid date') { return dateval; } - } + } } catch (err) { console.error('Error', err) } 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 9f9128ecfb678939717cbe9027cee09c226981ae..87bd39d7b06898428e0f21a5eaa2414b4387e402 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js @@ -1,3 +1,4 @@ + import React, {Component} from 'react'; import { Redirect } from 'react-router-dom'; import { InputText } from 'primereact/inputtext'; @@ -154,7 +155,7 @@ export class CycleCreate extends Component { * @param {string} key * @param {any} value */ - setCycleParams(key, value, type) { + async setCycleParams(key, value, type) { let cycle = _.cloneDeep(this.state.cycle); switch(type) { case 'NUMBER': { @@ -167,9 +168,11 @@ export class CycleCreate extends Component { } } if ( !this.state.isDirty && !_.isEqual(this.state.cycle, cycle) ) { - this.setState({cycle: cycle, validForm: this.validateForm(key), isDirty: true}); + await this.setState({cycle: cycle}); + await this.setState({validForm: this.validateForm(key), isDirty: true}); } else { - this.setState({cycle: cycle, validForm: this.validateForm(key)}); + await this.setState({cycle: cycle}); + await this.setState({validForm: this.validateForm(key)}); } } @@ -208,6 +211,7 @@ export class CycleCreate extends Component { * If no argument passed for fieldName, validates all fields in the form. * @param {string} fieldName */ + validateForm(fieldName) { let validForm = false; let errors = this.state.errors; @@ -243,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. */ @@ -267,8 +278,8 @@ export class CycleCreate extends Component { let cycleQuota = []; let cycle = this.state.cycle; let stoptime = _.replace(this.state.cycle['stop'],'00:00:00', '23:59:59'); - cycle['start'] = moment(cycle['start']).format("YYYY-MM-DDTHH:mm:ss"); - cycle['stop'] = moment(stoptime).format("YYYY-MM-DDTHH:mm:ss"); + cycle['start'] = moment(cycle['start']).format(UIConstants.UTC_DATE_TIME_FORMAT); + cycle['stop'] = moment(stoptime).format(UIConstants.UTC_DATE_TIME_FORMAT); this.setState({cycle: cycle, isDirty: false}); for (const resource in this.state.cycleQuota) { let resourceType = _.find(this.state.resources, {'name': resource}); @@ -420,10 +431,9 @@ export class CycleCreate extends Component { <label htmlFor="cycleName" className="col-lg-2 col-md-2 col-sm-12">Start Date <span style={{color:'red'}}>*</span></label> <div className="col-lg-3 col-md-3 col-sm-12"> <Calendar - d dateFormat="dd-M-yy" + d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} value= {this.state.cycle.start} onChange= {e => this.setCycleParams('start',e.value)} - onBlur= {e => this.setCycleParams('start',e.value)} data-testid="start" tooltip="Moment at which the cycle starts, that is, when its projects can run." tooltipOptions={this.tooltipOptions} showIcon={true} @@ -437,10 +447,9 @@ export class CycleCreate extends Component { <label htmlFor="cycleName" className="col-lg-2 col-md-2 col-sm-12">Stop Date <span style={{color:'red'}}>*</span></label> <div className="col-lg-3 col-md-3 col-sm-12"> <Calendar - d dateFormat="dd-M-yy" + d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} value= {this.state.cycle.stop} onChange= {e => this.setCycleParams('stop', e.value)} - onBlur= {e => this.setCycleParams('stop',e.value)} data-testid="stop" tooltip="Moment at which the cycle officially ends." tooltipOptions={this.tooltipOptions} showIcon={true} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js index ce35f79a059ea97f43acc334c394927107f82a55..7ef3b05cc8bf50d554ae4f4fcd64e409b7e853c0 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js @@ -195,7 +195,7 @@ export class CycleEdit extends Component { * @param {string} key * @param {any} value */ - setCycleParams(key, value, type) { + async setCycleParams(key, value, type) { let cycle = _.cloneDeep(this.state.cycle); switch(type) { case 'NUMBER': { @@ -208,9 +208,11 @@ export class CycleEdit extends Component { } } if ( !this.state.isDirty && !_.isEqual(this.state.cycle, cycle)) { - this.setState({cycle: cycle, validForm: this.validateForm(key), isDirty: true}); + await this.setState({cycle: cycle}); + this.setState({validForm: this.validateForm(key), isDirty: true}); } else { - this.setState({cycle: cycle, validForm: this.validateForm(key)}); + await await this.setState({cycle: cycle}); + this.setState({validForm: this.validateForm(key)}); } } @@ -307,8 +309,8 @@ export class CycleEdit extends Component { if (this.validateForm) { let cycle = this.state.cycle; let stoptime = _.replace(this.state.cycle['stop'],'00:00:00', '23:59:59'); - cycle['start'] = moment(this.state.cycle['start']).format("YYYY-MM-DDTHH:mm:ss"); - cycle['stop'] = moment(stoptime).format("YYYY-MM-DDTHH:mm:ss"); + cycle['start'] = moment(cycle['start']).format(UIConstants.UTC_DATE_TIME_FORMAT); + cycle['stop'] = moment(stoptime).format(UIConstants.UTC_DATE_TIME_FORMAT); this.setState({cycle: cycle, isDirty: false}); CycleService.updateCycle(this.props.match.params.id, this.state.cycle) .then(async (cycle) => { @@ -452,11 +454,10 @@ export class CycleEdit extends Component { <label htmlFor="cycleName" className="col-lg-2 col-md-2 col-sm-12">Start Date <span style={{color:'red'}}>*</span></label> <div className="col-lg-3 col-md-3 col-sm-12"> <Calendar - d dateFormat="dd-M-yy" + d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} inputId="start" value= {new Date(this.state.cycle.start)} onChange= {e => this.setCycleParams('start',e.value)} - onBlur= {e => this.setCycleParams('start',e.value)} data-testid="start" tooltip="Moment at which the cycle starts, that is, when its projects can run." tooltipOptions={this.tooltipOptions} showIcon={true} @@ -469,10 +470,9 @@ export class CycleEdit extends Component { <label htmlFor="cycleName" className="col-lg-2 col-md-2 col-sm-12">Stop Date <span style={{color:'red'}}>*</span></label> <div className="col-lg-3 col-md-3 col-sm-12"> <Calendar - d dateFormat="dd-M-yy" + d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} value= {new Date(this.state.cycle.stop)} onChange= {e => this.setCycleParams('stop', e.value)} - onBlur= {e => this.setCycleParams('stop',e.value)} inputId="stop" data-testid="stop" tooltip="Moment at which the cycle officially ends." tooltipOptions={this.tooltipOptions} 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 7c2e144921092212bfe3e38506ba824aa56b864b..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,12 +2,12 @@ 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'; import AppLoader from '../../layout/components/AppLoader'; import PageHeader from '../../layout/components/PageHeader'; +import UIConstants from '../../utils/ui.constants'; class CycleList extends Component{ constructor(props){ @@ -24,15 +24,18 @@ class CycleList extends Component{ this.defaultcolumns = [ { id:"Cycle Code", start: { name: "Start Date", - filter: "date" + filter: "date", + format: UIConstants.CALENDAR_DEFAULTDATE_FORMAT }, stop: { name: "End Date", - filter: "date" + filter: "date", + format: UIConstants.CALENDAR_DEFAULTDATE_FORMAT }, duration:{ name: "Duration (Days)", - filter: "range" + filter: "range", + format: UIConstants.CALENDAR_TIME_FORMAT }, totalProjects:{ name:'No.of Projects', @@ -110,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("YYYY-MMM-DD"); - cycle.stop = moment(cycle['stop'], moment.ISO_8601).format("YYYY-MMM-DD"); - // 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/Cycle/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js index 2d2b1cc5c039afd5b4759bb0391a6d2094825f4d..47c90d8bcbca18c07900b81a15d3ed7512a5099a 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js @@ -11,13 +11,14 @@ import AppLoader from '../../layout/components/AppLoader'; import PageHeader from '../../layout/components/PageHeader'; import CycleService from '../../services/cycle.service'; import UnitConverter from '../../utils/unit.converter'; +import UIConstants from '../../utils/ui.constants'; import {ProjectList} from './../Project/list'; /** * Component to view the details of a cycle */ export class CycleView extends Component { - DATE_FORMAT = 'YYYY-MMM-DD HH:mm:ss'; + // DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss'; constructor(props) { super(props); this.state = { @@ -110,9 +111,9 @@ export class CycleView extends Component { </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Created At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.cycle.created_at).format(this.DATE_FORMAT)}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.cycle.created_at).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> <label className="col-lg-2 col-md-2 col-sm-12">Updated At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.cycle.updated_at).format(this.DATE_FORMAT)}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.cycle.updated_at).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> </div> {/* <div className="p-grid"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js index 3b165cb8cffcc7e0db48410740c93ad3a2e0b80a..257a90f69a5036a9f72c383e13edecb61b69c235 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js @@ -13,12 +13,12 @@ import ProjectService from '../../services/project.service'; import UnitConverter from '../../utils/unit.converter'; import SchedulingUnitList from './../Scheduling/SchedulingUnitList'; import SUBCreator from '../Scheduling/sub.create'; +import UIConstants from '../../utils/ui.constants'; /** * Component to view the details of a project */ export class ProjectView extends Component { - DATE_FORMAT = 'YYYY-MMM-DD HH:mm:ss'; constructor(props) { super(props); this.state = { @@ -142,9 +142,9 @@ export class ProjectView extends Component { </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Created At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.project.created_at).format(this.DATE_FORMAT)}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.project.created_at).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> <label className="col-lg-2 col-md-2 col-sm-12">Updated At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.project.updated_at).format(this.DATE_FORMAT)}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.project.updated_at).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Trigger Priority</label> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Scheduling.Constraints.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Scheduling.Constraints.js index 9b418979a084bac5f9da59afe050a7b7a4bcc2a7..35725047eaeceb182457875029cbba90b4cd7320 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Scheduling.Constraints.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Scheduling.Constraints.js @@ -3,6 +3,7 @@ import moment from 'moment'; import _ from 'lodash'; import Jeditor from '../../components/JSONEditor/JEditor'; import UnitConversion from '../../utils/unit.converter'; +import UIConstants from '../../utils/ui.constants'; /* eslint-disable react-hooks/exhaustive-deps */ export default (props) => { @@ -74,7 +75,7 @@ export default (props) => { propertyValue.skipFormat = true; propertyValue.options = { "inputAttributes": { - "placeholder": "yyyy-mm-dd,--:--:--" + "placeholder": "YYYY-MM-DD HH:mm:ss" }, "flatpickr": { "inlineHideInput": true, @@ -162,11 +163,11 @@ export default (props) => { // For DateTime for (let key in initValue.time) { if (typeof initValue.time[key] === 'string') { - initValue.time[key] = moment(new Date((initValue.time[key] || '').replace('Z', ''))).format("YYYY-MM-DD HH:mm:ss"); + initValue.time[key] = moment(new Date((initValue.time[key] || '').replace('Z', ''))).format(UIConstants.CALENDAR_DATETIME_FORMAT); } else { initValue.time[key].forEach(time => { for (let subKey in time) { - time[subKey] = moment(new Date((time[subKey] || '').replace('Z', ''))).format("YYYY-MM-DD HH:mm:ss"); + time[subKey] = moment(new Date((time[subKey] || '').replace('Z', ''))).format(UIConstants.CALENDAR_DATETIME_FORMAT); } return true; }) 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 89b205df8da2e4e7d11c132f255dcc76be8a3173..2e173e9085a13141c43365b63a7dab3778440cef 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js @@ -8,6 +8,7 @@ import _ from 'lodash'; import ScheduleService from '../../services/schedule.service'; import { Link } from 'react-router-dom'; import WorkflowService from '../../services/workflow.service'; +import UIConstants from '../../utils/ui.constants'; import { DataTable } from 'primereact/datatable'; import { Column } from 'primereact/column'; import { CustomDialog } from '../../layout/components/CustomDialog'; @@ -31,10 +32,20 @@ class SchedulingUnitList extends Component{ }, project:"Project", name:"Name", - start_time:"Start Time", - stop_time:"End time", - duration:"Duration (HH:mm:ss)", - + 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:{ + name:"Duration (HH:mm:ss)", + format:UIConstants.CALENDAR_TIME_FORMAT + } }; if (props.hideProjectColumn) { delete this.defaultcolumns['project']; @@ -100,8 +111,14 @@ class SchedulingUnitList extends Component{ name: "Cancelled", filter: "switch", }, - created_at:"Created_At", - updated_at:"Updated_At" + created_at:{ + name:"Created_At", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + updated_at:{ + name:"Updated_At", + format:UIConstants.CALENDAR_DATETIME_FORMAT + } }], columnclassname: [{ "Scheduling Unit ID":"filter-input-50", @@ -269,8 +286,10 @@ class SchedulingUnitList extends Component{ blueP.duration = moment.utc((blueP.duration || 0)*1000).format('HH:mm:ss'); blueP.type="Blueprint"; blueP['actionpath'] ='/schedulingunit/view/blueprint/'+blueP.id; - blueP['created_at'] = moment(blueP['created_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); - blueP['updated_at'] = moment(blueP['updated_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); + // blueP['created_at'] = moment(blueP['created_at'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // blueP['updated_at'] = moment(blueP['updated_at'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // blueP['start_time'] = moment(blueP['start_time'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // blueP['stop_time'] = moment(blueP['stop_time'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); blueP['task_content'] = this.getTaskTypeGroupCounts(blueP['task_blueprints']); blueP['linked_bp_draft'] = this.getLinksList([blueP.draft_id], 'draft'); blueP['template_description'] = obsStrategyTemplate.description; @@ -280,10 +299,6 @@ class SchedulingUnitList extends Component{ blueP['suid'] = blueP.id; blueP.canSelect = true; blueP.suSet = suSet.name; - // blueP.links = ['Project']; - // blueP.linksURL = { - // 'Project': `/project/view/${project.name}` - // } blueP.links = ['Project', 'id']; blueP.linksURL = { 'Project': `/project/view/${project.name}`, @@ -295,8 +310,10 @@ class SchedulingUnitList extends Component{ scheduleunit['actionpath']='/schedulingunit/view/draft/'+scheduleunit.id; scheduleunit['type'] = 'Draft'; scheduleunit['duration'] = moment.utc((scheduleunit.duration || 0)*1000).format('HH:mm:ss'); - scheduleunit['created_at'] = moment(scheduleunit['created_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); - scheduleunit['updated_at'] = moment(scheduleunit['updated_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); + // scheduleunit['created_at'] = moment(scheduleunit['created_at'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // scheduleunit['updated_at'] = moment(scheduleunit['updated_at'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // scheduleunit['start_time'] = moment(scheduleunit['start_time'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // scheduleunit['stop_time'] = moment(scheduleunit['stop_time'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); scheduleunit.project = project.name; scheduleunit.canSelect = true; scheduleunit.suSet = suSet.name; diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js index 06a81716d63b2e88aa3b15bbe19c101d62834dec..58add662c42b12bdc0d882f4e7852dfa334dc3c7 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js @@ -23,6 +23,7 @@ import { appGrowl } from '../../layout/components/AppGrowl'; import Schedulingtaskrelation from './Scheduling.task.relation'; import UnitConverter from '../../utils/unit.converter'; import TaskService from '../../services/task.service'; +import UIConstants from '../../utils/ui.constants'; class ViewSchedulingUnit extends Component{ constructor(props){ @@ -78,13 +79,18 @@ class ViewSchedulingUnit extends Component{ description:"Description", start_time:{ name:"Start Time", - filter: "date" + filter: "date", + format:UIConstants.CALENDAR_DATETIME_FORMAT }, stop_time:{ name:"End Time", - filter: "date" + filter: "date", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + duration:{ + name:"Duration (HH:mm:ss)", + format:UIConstants.CALENDAR_TIME_FORMAT }, - duration:"Duration (HH:mm:ss)", relative_start_time:"Relative Start Time (HH:mm:ss)", relative_stop_time:"Relative End Time (HH:mm:ss)", noOfOutputProducts: "#Dataproducts", @@ -102,11 +108,13 @@ class ViewSchedulingUnit extends Component{ url:"API URL", created_at:{ name: "Created at", - filter: "date" + filter:"date", + format:UIConstants.CALENDAR_DATETIME_FORMAT }, updated_at:{ name: "Updated at", - filter: "date" + filter: "date", + format:UIConstants.CALENDAR_DATETIME_FORMAT }, actionpath:"actionpath" }], @@ -209,6 +217,10 @@ class ViewSchedulingUnit extends Component{ task.size = 0; task.dataSizeOnDisk = 0; task.noOfOutputProducts = 0; + // task.stop_time = moment(task.stop_time).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // task.start_time = moment(task.start_time).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // task.created_at = moment(task.created_at).format(UIConstants.CALENDAR_DATETIME_FORMAT); + // task.updated_at = moment(task.updated_at).format(UIConstants.CALENDAR_DATETIME_FORMAT); task.canSelect = task.tasktype.toLowerCase() === 'blueprint' ? true:(task.tasktype.toLowerCase() === 'draft' && task.blueprint_draft.length === 0)?true:false; if (dataProducts.length && dataProducts[0].length) { task.dataProducts = dataProducts[0]; @@ -286,17 +298,14 @@ class ViewSchedulingUnit extends Component{ scheduletask['actionpath'] = '/task/view/draft/'+task['id']; scheduletask['blueprint_draft'] = _.map(task['task_blueprints'], 'url'); scheduletask['status'] = task['status']; - //fetch task draft details for(const key of commonkeys){ scheduletask[key] = task[key]; } - scheduletask['created_at'] = moment(task['created_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); - scheduletask['updated_at'] = moment(task['updated_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); scheduletask['specifications_doc'] = task['specifications_doc']; - scheduletask.duration = moment.utc((scheduletask.duration || 0)*1000).format('HH:mm:ss'); - scheduletask.relative_start_time = moment.utc(scheduletask.relative_start_time*1000).format('HH:mm:ss'); - scheduletask.relative_stop_time = moment.utc(scheduletask.relative_stop_time*1000).format('HH:mm:ss'); + scheduletask.duration = moment.utc((scheduletask.duration || 0)*1000).format(UIConstants.CALENDAR_TIME_FORMAT); + scheduletask.relative_start_time = moment.utc(scheduletask.relative_start_time*1000).format(UIConstants.CALENDAR_TIME_FORMAT); + scheduletask.relative_stop_time = moment.utc(scheduletask.relative_stop_time*1000).format(UIConstants.CALENDAR_TIME_FORMAT); scheduletask.template = task.specifications_template; scheduletask.type_value = task.specifications_template.type_value; scheduletask.produced_by = task.produced_by; @@ -312,11 +321,11 @@ class ViewSchedulingUnit extends Component{ for(const key of commonkeys){ taskblueprint[key] = blueprint[key]; } - taskblueprint['created_at'] = moment(blueprint['created_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); - taskblueprint['updated_at'] = moment(blueprint['updated_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); - taskblueprint.duration = moment.utc((taskblueprint.duration || 0)*1000).format('HH:mm:ss'); - taskblueprint.relative_start_time = moment.utc(taskblueprint.relative_start_time*1000).format('HH:mm:ss'); - taskblueprint.relative_stop_time = moment.utc(taskblueprint.relative_stop_time*1000).format('HH:mm:ss'); + taskblueprint['created_at'] = moment(blueprint['created_at'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + taskblueprint['updated_at'] = moment(blueprint['updated_at'], moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT); + taskblueprint.duration = moment.utc((taskblueprint.duration || 0)*1000).format(UIConstants.CALENDAR_TIME_FORMAT); + taskblueprint.relative_start_time = moment.utc(taskblueprint.relative_start_time*1000).format(UIConstants.CALENDAR_TIME_FORMAT); + taskblueprint.relative_stop_time = moment.utc(taskblueprint.relative_stop_time*1000).format(UIConstants.CALENDAR_TIME_FORMAT); taskblueprint.template = scheduletask.template; taskblueprint.subTasks = blueprint.subtasks; for (const subtask of taskblueprint.subTasks) { @@ -352,7 +361,7 @@ class ViewSchedulingUnit extends Component{ taskBlueprint['blueprint_draft'] = taskBlueprint['draft']; taskBlueprint['relative_start_time'] = 0; taskBlueprint['relative_stop_time'] = 0; - taskBlueprint.duration = moment.utc((taskBlueprint.duration || 0)*1000).format('HH:mm:ss'); + taskBlueprint.duration = moment.utc((taskBlueprint.duration || 0)*1000).format(UIConstants.CALENDAR_TIME_FORMAT); taskBlueprint.template = taskBlueprint.specifications_template; for (const subtask of taskBlueprint.subtasks) { subtask.subTaskTemplate = _.find(this.subtaskTemplates, ['id', subtask.specifications_template_id]); @@ -549,19 +558,19 @@ class ViewSchedulingUnit extends Component{ </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Created At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment(this.state.scheduleunit.created_at).format("YYYY-MMM-DD HH:mm:SS")}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.created_at && moment(this.state.scheduleunit.created_at,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> <label className="col-lg-2 col-md-2 col-sm-12">Updated At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment(this.state.scheduleunit.updated_at).format("YYYY-MMM-DD HH:mm:SS")}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.created_at && moment(this.state.scheduleunit.updated_at,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Start Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.start_time && moment(this.state.scheduleunit.start_time).format("YYYY-MMM-DD HH:mm:SS")}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.start_time && moment(this.state.scheduleunit.start_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> <label className="col-lg-2 col-md-2 col-sm-12">End Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.stop_time && moment(this.state.scheduleunit.stop_time).format("YYYY-MMM-DD HH:mm:SS")}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.stop_time && moment(this.state.scheduleunit.stop_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12" >Duration (HH:mm:ss)</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc((this.state.scheduleunit.duration?this.state.scheduleunit.duration:0)*1000).format('HH:mm:ss')}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc((this.state.scheduleunit.duration?this.state.scheduleunit.duration:0)*1000).format(UIConstants.CALENDAR_TIME_FORMAT)}</span> <label className="col-lg-2 col-md-2 col-sm-12">Template ID</label> <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.observation_strategy_template_id}</span> </div> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js index 9aeff323993dd4be253c5d5f19007d5b6b29532f..9108dd89a36bd17a3c8f2a48c239137e2cb7f365 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js @@ -36,7 +36,7 @@ import 'ag-grid-community/dist/styles/ag-theme-alpine.css'; import { CustomPageSpinner } from '../../components/CustomPageSpinner'; import { CustomDialog } from '../../layout/components/CustomDialog'; -const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; +// const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; const BG_COLOR = '#f878788f'; /** @@ -1174,9 +1174,9 @@ export class SchedulingSetCreate extends Component { if (constraint.scheduler){ observationProps['scheduler'] = constraint.scheduler; } - observationProps['timeat'] = this.isNotEmpty(constraint.time.at)?moment.utc(constraint.time.at).format(DATE_TIME_FORMAT): ''; - observationProps['timeafter'] = this.isNotEmpty(constraint.time.after)?moment.utc(constraint.time.after).format(DATE_TIME_FORMAT):''; - observationProps['timebefore'] = this.isNotEmpty(constraint.time.before)?moment.utc(constraint.time.before).format(DATE_TIME_FORMAT):''; + observationProps['timeat'] = this.isNotEmpty(constraint.time.at)?moment.utc(constraint.time.at).format(UIConstants.CALENDAR_DATETIME_FORMAT): ''; + observationProps['timeafter'] = this.isNotEmpty(constraint.time.after)?moment.utc(constraint.time.after).format(UIConstants.CALENDAR_DATETIME_FORMAT):''; + observationProps['timebefore'] = this.isNotEmpty(constraint.time.before)?moment.utc(constraint.time.before).format(UIConstants.CALENDAR_DATETIME_FORMAT):''; if (constraint.time.between){ observationProps['between'] = this.getBetweenStringValue(constraint.time.between); } @@ -1796,18 +1796,18 @@ export class SchedulingSetCreate extends Component { } else { //mandatory - constraint.time.at = `${moment(suRow.timeat).format("YYYY-MM-DDTHH:mm:ss.SSSSS", { trim: false })}Z`; + constraint.time.at = `${moment(suRow.timeat).format(UIConstants.UTC_DATE_TIME_MS_FORMAT, { trim: false })}Z`; //optional if (!this.isNotEmpty(suRow.timeafter)) { delete constraint.time.after; } else { - constraint.time.after = `${moment(suRow.timeafter).format("YYYY-MM-DDTHH:mm:ss.SSSSS", { trim: false })}Z`; + constraint.time.after = `${moment(suRow.timeafter).format(UIConstants.UTC_DATE_TIME_MS_FORMAT, { trim: false })}Z`; } if (!this.isNotEmpty(suRow.timebefore)) { delete constraint.time.before; } else { - constraint.time.before = `${moment(suRow.timebefore).format("YYYY-MM-DDTHH:mm:ss.SSSSS", { trim: false })}Z`; + constraint.time.before = `${moment(suRow.timebefore).format(UIConstants.UTC_DATE_TIME_MS_FORMAT, { trim: false })}Z`; } } @@ -1916,11 +1916,12 @@ export class SchedulingSetCreate extends Component { * @param {*} dates */ getBetweenStringValue(dates){ + console.log(dates); let returnDate = ''; if (dates){ dates.forEach(utcDateArray => { - returnDate += moment.utc(utcDateArray.from).format(DATE_TIME_FORMAT)+","; - returnDate += moment.utc(utcDateArray.to).format(DATE_TIME_FORMAT)+"|"; + returnDate += moment.utc(utcDateArray.from).format(UIConstants.CALENDAR_DATETIME_FORMAT)+","; + returnDate += moment.utc(utcDateArray.to).format(UIConstants.CALENDAR_DATETIME_FORMAT)+"|"; }) } return returnDate; @@ -1937,8 +1938,8 @@ export class SchedulingSetCreate extends Component { let betweendate = _.split(betweenDates, ","); let dateres = {}; if (betweendate && betweendate.length === 2){ - dateres['from'] = `${moment(betweendate[0]).format("YYYY-MM-DDTHH:mm:SS.SSSSS", { trim: false })}Z`; - dateres['to'] = `${moment(betweendate[1]).format("YYYY-MM-DDTHH:mm:SS.SSSSS", { trim: false })}Z`; + dateres['from'] = `${moment(betweendate[0]).format(UIConstants.UTC_DATE_TIME_MS_FORMAT, { trim: false })}Z`; + dateres['to'] = `${moment(betweendate[1]).format(UIConstants.UTC_DATE_TIME_MS_FORMAT, { trim: false })}Z`; returnDate.push(dateres); } }) diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js index 34a30be396738c0e800ae52c47c164291f86821c..0fd8c88cce18cf3a98c9006ee9d86ae2124d2fb7 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js @@ -5,6 +5,7 @@ import _ from 'lodash'; import ViewTable from '../../components/ViewTable'; import { JsonToTable } from "react-json-to-table"; import SchedulingConstraints from './Scheduling.Constraints'; +import UIConstants from '../../utils/ui.constants'; // import Stations from './Stations'; /** @@ -61,7 +62,7 @@ export class SchedulingUnitSummary extends Component { try { const dateConstraint = moment.utc(constraint); if (dateConstraint.isValid()) { - constraint = dateConstraint.format("YYYY-MM-DD HH:mm:ss"); + constraint = dateConstraint.format(UIConstants.CALENDAR_DATETIME_FORMAT); } } catch (error) {} break; @@ -130,9 +131,9 @@ export class SchedulingUnitSummary extends Component { <div className="col-4"><label>Project:</label></div> <div className="col-8">{schedulingUnit.project}</div> <div className="col-4"><label>Start Time:</label></div> - <div className="col-8">{moment.utc(schedulingUnit.start_time).format("DD-MMM-YYYY HH:mm:ss")}</div> + <div className="col-8">{moment.utc(schedulingUnit.start_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</div> <div className="col-4"><label>Stop Time:</label></div> - <div className="col-8">{moment.utc(schedulingUnit.stop_time).format("DD-MMM-YYYY HH:mm:ss")}</div> + <div className="col-8">{moment.utc(schedulingUnit.stop_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</div> <div className="col-4"><label>Status:</label></div> <div className="col-8">{schedulingUnit.status}</div> {constraintsTemplate && schedulingUnit.suDraft.scheduling_constraints_doc && diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js index b18a10c8f073e914f39a0cc540a48a0095738c7c..f89c15afe62c4ea33919c10b6a7e1de07c01a4e3 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js @@ -4,6 +4,7 @@ import moment from 'moment'; import _ from 'lodash'; import Jeditor from '../../components/JSONEditor/JEditor'; import TaskService from '../../services/task.service'; +import UIConstants from '../../utils/ui.constants'; import { Chips } from 'primereact/chips'; import { Dialog } from 'primereact/dialog'; import { CustomDialog } from '../../layout/components/CustomDialog'; @@ -15,7 +16,7 @@ import { DataTable } from 'primereact/datatable'; import { Column } from 'primereact/column'; export class TaskView extends Component { - DATE_FORMAT = 'YYYY-MMM-DD HH:mm:ss'; + // DATE_FORMAT = 'YYYY-MMM-DD HH:mm:ss'; constructor(props) { super(props); this.state = { @@ -268,9 +269,9 @@ export class TaskView extends Component { </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Created At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.task.created_at).format(this.DATE_FORMAT)}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.task.created_at).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> <label className="col-lg-2 col-md-2 col-sm-12">Updated At</label> - <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.task.updated_at).format(this.DATE_FORMAT)}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.task.updated_at).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Copies</label> @@ -280,9 +281,9 @@ export class TaskView extends Component { </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Start Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.start?moment.utc(this.state.task.start).format(this.DATE_FORMAT):""}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.start_time?moment(this.state.task.start_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> <label className="col-lg-2 col-md-2 col-sm-12">End Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.end?moment.utc(this.state.task.end).format(this.DATE_FORMAT):""}</span> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.end_time?moment(this.state.task.end_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Tags</label> 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 73856d5af49e1aecdb35d1bd1d94374298352022..4809304616b85fe9a91f3828a8a16f5b29f64dda 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 @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { Redirect } from 'react-router-dom'; import _ from 'lodash'; +import moment from 'moment'; import { Growl } from 'primereact/components/growl/Growl'; import AppLoader from '../../layout/components/AppLoader'; import PageHeader from '../../layout/components/PageHeader'; @@ -234,6 +235,7 @@ export class ReservationCreate extends Component { saveReservation(){ let reservation = this.state.reservation; let project = this.projects.find(project => project.name === reservation.project); + reservation['start_time'] = moment(reservation['start_time']).format(UIConstants.CALENDAR_DATETIME_FORMAT); reservation['duration'] = ( reservation['duration'] === ''? null: UnitService.getHHmmssToSecs(reservation['duration'])); reservation['project']= project ? project.url: null; reservation['specifications_template']= this.reservationTemplates[0].url; @@ -355,10 +357,9 @@ 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="dd-M-yy" + d dateFormat="yy-mm-dd" value= {this.state.reservation.start_time} onChange= {e => this.setParams('start_time',e.value)} - onBlur= {e => this.setParams('start_time',e.value)} data-testid="start_time" tooltip="Moment at which the reservation starts from, that is, when its reservation can run." tooltipOptions={this.tooltipOptions} showIcon={true} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.list.js index 5c7609d000e1a11d22648fa1d7974af505b876c5..dd776d470c2d3a496d7a3f355cad38d47f75dd28 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.list.js @@ -9,6 +9,7 @@ import moment from 'moment'; import { MultiSelect } from 'primereact/multiselect'; import { Calendar } from 'primereact/calendar'; import UnitService from '../../utils/unit.converter'; +import UIConstants from '../../utils/ui.constants'; export class ReservationList extends Component{ constructor(props){ @@ -26,13 +27,18 @@ export class ReservationList extends Component{ description:"Description", start_time: { name: "Start Time", - filter: "fromdatetime" + filter: "fromdatetime", + format:UIConstants.CALENDAR_DATETIME_FORMAT }, end_time: { name: "End Time", - filter: "todatetime" + filter: "todatetime", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + duration:{ + name:"Duration (HH:mm:ss)", + format:UIConstants.CALENDAR_TIME_FORMAT }, - duration:"Duration (HH:mm:ss)", type: { name:"Reservation type", filter:"select" @@ -124,9 +130,9 @@ export class ReservationList extends Component{ reservation.duration = UnitService.getSecsToHHmmss(reservation.duration); let endDate = moment(reservation.start_time); endDate = moment(endDate).add(duration, 's'); - reservation['end_time']= moment(endDate).format('YYYY-MM-DD HH:mm:ss'); + reservation['end_time']= moment(endDate).format(UIConstants.CALENDAR_DATETIME_FORMAT); } - reservation['start_time']= moment(reservation.start_time).format('YYYY-MM-DD HH:mm:ss'); + reservation['start_time']= moment(reservation['start_time']).format(UIConstants.CALENDAR_DATETIME_FORMAT); this.reservations.push(reservation); }; this.cycleList.map(cycle => { @@ -324,11 +330,10 @@ export class ReservationList extends Component{ <span className="p-float-label"> <Calendar id="fstartdate" - d dateFormat="dd-M-yy" + d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} value= {this.state.fStartTime} // placeholder="Select Start Date Time" onChange= {e => this.setDateRange('fStartTime', e.value)} - onBlur= {e => this.setDateRange('fStartTime',e.value)} tooltip="Select Reserved Between - From" tooltipOptions={this.tooltipOptions} showIcon={true} showTime={true} @@ -347,11 +352,10 @@ export class ReservationList extends Component{ <span className="p-float-label"> <Calendar id="fenddate" - d dateFormat="dd-M-yy" + d dateFormat={UIConstants.CALENDAR_DATE_FORMAT} value= {this.state.fEndTime} // placeholder="Select End Date Time" onChange= {e => this.setDateRange('fEndTime', e.value)} - onBlur= {e => this.setDateRange('fEndTime', e.value)} tooltip="Select Reserved Between-To" tooltipOptions={this.tooltipOptions} showIcon={true} showTime={true} 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 12e476f26f5832d9c64011f536542dd9190e7f05..828386d19450af0473e199ad44430a7b4491e8ed 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js @@ -16,6 +16,7 @@ import ViewTable from '../../components/ViewTable'; import ProjectService from '../../services/project.service'; import ScheduleService from '../../services/schedule.service'; import UtilService from '../../services/util.service'; +import UIConstants from '../../utils/ui.constants'; import TaskService from '../../services/task.service'; import UnitConverter from '../../utils/unit.converter'; @@ -873,7 +874,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",}]} @@ -1003,9 +1012,9 @@ export class TimelineView extends Component { <div className="col-7">{mouseOverItem.name}</div> </>} <label className={`col-5 su-${mouseOverItem.status}-icon`}>Start Time:</label> - <div className="col-7">{mouseOverItem.start_time.format("YYYY-MM-DD HH:mm:ss")}</div> + <div className="col-7">{mouseOverItem.start_time.format(UIConstants.CALENDAR_DATETIME_FORMAT)}</div> <label className={`col-5 su-${mouseOverItem.status}-icon`}>End Time:</label> - <div className="col-7">{mouseOverItem.end_time.format("YYYY-MM-DD HH:mm:ss")}</div> + <div className="col-7">{mouseOverItem.end_time.format(UIConstants.CALENDAR_DATETIME_FORMAT)}</div> {mouseOverItem.type==='SCHEDULE' && <> <label className={`col-5 su-${mouseOverItem.status}-icon`}>Antenna Set:</label> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js index 75b8b2ca961f1a476c01a7cb3f391fe37c431f25..fa976d92bec5bdf942d813a4a11d2daaea9185da 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js @@ -687,9 +687,9 @@ export class WeekTimelineView extends Component { <label className={`col-5 su-${mouseOverItem.status}-icon`}>Friends:</label> <div className="col-7">{mouseOverItem.friends?mouseOverItem.friends:"-"}</div> <label className={`col-5 su-${mouseOverItem.status}-icon`}>Start Time:</label> - <div className="col-7">{mouseOverItem.suStartTime.format("YYYY-MM-DD HH:mm:ss")}</div> + <div className="col-7">{mouseOverItem.suStartTime.format(UIConstants.CALENDAR_DATETIME_FORMAT)}</div> <label className={`col-5 su-${mouseOverItem.status}-icon`}>End Time:</label> - <div className="col-7">{mouseOverItem.suStopTime.format("YYYY-MM-DD HH:mm:ss")}</div> + <div className="col-7">{mouseOverItem.suStopTime.format(UIConstants.CALENDAR_DATETIME_FORMAT)}</div> <label className={`col-5 su-${mouseOverItem.status}-icon`}>Antenna Set:</label> <div className="col-7">{mouseOverItem.antennaSet}</div> <label className={`col-5 su-${mouseOverItem.status}-icon`}>Stations:</label> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js b/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js index e40ba3c94181bb1ad5409732b8961493113ca420..db6284425c56b108d1b5ff8dd08a341e6a78a9ef 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js @@ -241,14 +241,13 @@ const ScheduleService = { scheduletask['actionpath'] = '/task/view/draft/'+task['id']; scheduletask['blueprint_draft'] = task['task_blueprints']; scheduletask['status'] = task['status']; - //fetch task draft details for(const key of commonkeys){ scheduletask[key] = task[key]; } - scheduletask['created_at'] = moment(task['created_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); - scheduletask['updated_at'] = moment(task['updated_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); + scheduletask['created_at'] = moment(task['created_at'], moment.ISO_8601).format("YYYY-MM-DD HH:mm:ss"); + scheduletask['updated_at'] = moment(task['updated_at'], moment.ISO_8601).format("YYYY-MM-DD HH:mm:ss"); scheduletask['specifications_doc'] = task['specifications_doc']; scheduletask.duration = moment.utc((scheduletask.duration || 0)*1000).format('HH:mm:ss'); scheduletask.produced_by = task.produced_by; @@ -276,8 +275,8 @@ const ScheduleService = { for(const key of commonkeys){ taskblueprint[key] = blueprint[key]; } - taskblueprint['created_at'] = moment(blueprint['created_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); - taskblueprint['updated_at'] = moment(blueprint['updated_at'], moment.ISO_8601).format("YYYY-MMM-DD HH:mm:ss"); + taskblueprint['created_at'] = moment(blueprint['created_at'], moment.ISO_8601).format("YYYY-MM-DD HH:mm:ss"); + taskblueprint['updated_at'] = moment(blueprint['updated_at'], moment.ISO_8601).format("YYYY-MM-DD HH:mm:ss"); taskblueprint.duration = moment.utc((taskblueprint.duration || 0)*1000).format('HH:mm:ss'); taskblueprint.relative_start_time = moment.utc(taskblueprint.relative_start_time*1000).format('HH:mm:ss'); taskblueprint.relative_stop_time = moment.utc(taskblueprint.relative_stop_time*1000).format('HH:mm:ss'); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js b/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js index 1e759cd9b77bb6e216b93181f654065dc150d892..b4ca89eb6f0b31d99092b8d978ffb1e0e9c695f3 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js @@ -2,7 +2,13 @@ const UIConstants = { tooltipOptions: {position: 'left', event: 'hover', className:"p-tooltip-custom"}, timeline: { types: { NORMAL: "NORMAL", WEEKVIEW:"WEEKVIEW"} - } + }, + CALENDAR_DATE_FORMAT: 'yy-mm-dd', + CALENDAR_DATETIME_FORMAT : 'YYYY-MM-DD HH:mm:ss', + CALENDAR_TIME_FORMAT: 'HH:mm:ss', + CALENDAR_DEFAULTDATE_FORMAT: 'YYYY-MM-DD', + UTC_DATE_TIME_FORMAT: "YYYY-MM-DDTHH:mm:ss", + UTC_DATE_TIME_MS_FORMAT: "YYYY-MM-DDTHH:mm:ss.SSSSS" } export default UIConstants; \ No newline at end of file