Skip to content
Snippets Groups Projects
Commit b3bdb8df authored by Nithya's avatar Nithya
Browse files
Changes updated based on review comments
parent bf1c9d6a
Branches
Tags
1 merge request!374Resolve TMSS-494
...@@ -33,10 +33,10 @@ export default class DegreeInputMask extends Component { ...@@ -33,10 +33,10 @@ export default class DegreeInputMask extends Component {
render() { render() {
return ( return (
<InputMask mask="99:99:99" value={this.props.value} <InputMask mask="99:99:99.9999" value={this.props.value}
placeholder="DD:mm:ss" placeholder="DD:mm:ss.ssss"
className="inputmask" className="inputmask"
onComplete={this.callbackUpdateAngle} onChange={this.callbackUpdateAngle}
autoFocus autoFocus
ref={input =>{this.input = input}} /> ref={input =>{this.input = input}} />
); );
......
...@@ -33,10 +33,10 @@ export default class TimeInputMask extends Component { ...@@ -33,10 +33,10 @@ export default class TimeInputMask extends Component {
return ( return (
<InputMask <InputMask
value={this.props.value} value={this.props.value}
mask="99:99:99" mask="99:99:99.9999"
placeholder="HH:mm:ss" placeholder="HH:mm:ss.ssss"
className="inputmask" className="inputmask"
onComplete={this.callbackUpdateAngle} onChange={this.callbackUpdateAngle}
ref={input =>{this.input = input}} ref={input =>{this.input = input}}
/> />
); );
......
...@@ -235,3 +235,9 @@ In Excel View the for Accordion background color override ...@@ -235,3 +235,9 @@ In Excel View the for Accordion background color override
.p-grid { .p-grid {
width: -webkit-fill-available; width: -webkit-fill-available;
} }
.inputmask {
height: 35px;
width: 100px;
text-align: left;
border-color: transparent !important;
}
\ No newline at end of file
const Validator = { const Validator = {
validateTime(value) { validateTime(value) {
const splitOutput = value.split(':'); const splitOutput = value.split(':');
const seconds = splitOutput[2]?splitOutput[2].split('.')[0].split('.')[0]:splitOutput[2];
let milliSeconds = value.split('.')[1] || '0000';
milliSeconds = milliSeconds.padEnd(4,0);
if (splitOutput.length < 3) { if (splitOutput.length < 3) {
return false; return false;
} else { } else {
if (parseInt(splitOutput[0]) > 23 || parseInt(splitOutput[1])>59 || parseInt(splitOutput[2])>59) { if (parseInt(splitOutput[0]) > 23 || parseInt(splitOutput[1])>59 || parseInt(splitOutput[2])>59) {
return false; return false;
} }
const timeValue = parseInt(splitOutput[0]*60*60) + parseInt(splitOutput[1]*60) + parseInt(splitOutput[2]); const timeValue = parseInt(splitOutput[0]*60*60) + parseInt(splitOutput[1]*60) + parseInt(seconds) + milliSeconds/10000;
if (timeValue >= 86400) { if (timeValue >= 86400) {
return false; return false;
} }
...@@ -16,13 +19,16 @@ const Validator = { ...@@ -16,13 +19,16 @@ const Validator = {
}, },
validateAngle(value) { validateAngle(value) {
const splitOutput = value.split(':'); const splitOutput = value.split(':');
const seconds = splitOutput[2]?splitOutput[2].split('.')[0].split('.')[0]:splitOutput[2];
let milliSeconds = value.split('.')[1] || '0000';
milliSeconds = milliSeconds.padEnd(4,0);
if (splitOutput.length < 3) { if (splitOutput.length < 3) {
return false; return false;
} else { } else {
if (parseInt(splitOutput[0]) > 90 || parseInt(splitOutput[1])>59 || parseInt(splitOutput[2])>59) { if (parseInt(splitOutput[0]) > 90 || parseInt(splitOutput[1])>59 || parseInt(splitOutput[2])>59) {
return false; return false;
} }
const timeValue = parseInt(splitOutput[0]*60*60) + parseInt(splitOutput[1]*60) + parseInt(splitOutput[2]); const timeValue = parseInt(splitOutput[0]*60*60) + parseInt(splitOutput[1]*60) + parseInt(seconds) + milliSeconds/10000;
if (timeValue > 324000) { if (timeValue > 324000) {
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment