Compare commits
1 Commits
self-regis
...
round-time
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c6f17186e |
@@ -35,7 +35,7 @@ import Popover from 'material-ui/Popover';
|
||||
import ValidationErrorsInfoDialog from '../../../../../../../components/Shared/ValidationErrorsInfoDialog';
|
||||
|
||||
let DateTimeFormat;
|
||||
|
||||
const roundingTime = 1000 * 60 * 5; //5 minutes
|
||||
|
||||
DateTimeFormat = global.Intl.DateTimeFormat;
|
||||
|
||||
@@ -564,16 +564,18 @@ class VerticalNonLinear extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
let dateNow = new Date();
|
||||
|
||||
this.state = {
|
||||
stepIndex: 0,
|
||||
rideTypeValue: 0,
|
||||
providerID: 0,
|
||||
providerName: '',
|
||||
visitDate: new Date(),
|
||||
visitTime: new Date(),
|
||||
visitTime: new Date(Math.round(dateNow.getTime() / roundingTime) * roundingTime),
|
||||
pickupLocation: null,
|
||||
pickupTime: new Date(),
|
||||
pickupTimeReturn: new Date(),
|
||||
pickupTime: new Date(Math.round(dateNow.getTime() / roundingTime) * roundingTime),
|
||||
pickupTimeReturn: new Date(Math.round(dateNow.getTime() / roundingTime) * roundingTime),
|
||||
pickupTimeReturnDisplayMode: 'none',
|
||||
open: false,
|
||||
message: 'Adding Visit',
|
||||
@@ -638,10 +640,12 @@ class VerticalNonLinear extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
let visitTime = new Date(new Date().getTime() + (1 * 60 * 60 * 1000));
|
||||
let visitDate = visitTime;
|
||||
let pickupTime = new Date(visitTime.getTime() - (0.5 * 60 * 60 * 1000));
|
||||
let pickupTimeReturn = new Date(visitTime.getTime() - (0.5 * 60 * 60 * 1000));
|
||||
let date = new Date();
|
||||
|
||||
let visitTime = new Date(Math.round((date.getTime() + (1 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let visitDate = date;
|
||||
let pickupTime = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let pickupTimeReturn = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
|
||||
this.setState(Object.assign(this.state, {
|
||||
visitDate: visitDate,
|
||||
@@ -768,10 +772,10 @@ class VerticalNonLinear extends React.Component {
|
||||
|
||||
handleDate(event, date, state) {
|
||||
let self = state
|
||||
let visitTime = new Date(date.getTime() + (1 * 60 * 60 * 1000));
|
||||
let visitTime = new Date(Math.round((date.getTime() + (1 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let visitDate = date;
|
||||
let pickupTime = new Date(visitTime.getTime() - (0.5 * 60 * 60 * 1000));
|
||||
let pickupTimeReturn = new Date(visitTime.getTime() - (0.5 * 60 * 60 * 1000));
|
||||
let pickupTime = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let pickupTimeReturn = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
|
||||
self.setState(Object.assign(self.state, {
|
||||
visitDate: visitDate,
|
||||
|
||||
@@ -17,8 +17,6 @@ import Toggle from 'material-ui/Toggle';
|
||||
import Snackbar from 'material-ui/Snackbar';
|
||||
import Instance from '../../../components/Connection';
|
||||
|
||||
import Checkbox from 'material-ui/Checkbox';
|
||||
|
||||
import ValidationErrorsInfoDialog from '../../../components/Shared/ValidationErrorsInfoDialog';
|
||||
|
||||
class SignUp extends React.Component {
|
||||
@@ -43,8 +41,7 @@ class SignUp extends React.Component {
|
||||
"passConfirmation": "",
|
||||
"organizationType": { name: "", key: "provider", desc: "" },
|
||||
showValidationErrors: false,
|
||||
validationErrors: [],
|
||||
agreedTerms:false,
|
||||
validationErrors: []
|
||||
}
|
||||
|
||||
this.buttonValidated = this.buttonValidated.bind(this);
|
||||
@@ -70,7 +67,7 @@ class SignUp extends React.Component {
|
||||
if (!this.state.first || this.state.first === null || this.state.first === "") validated = false;
|
||||
if (!this.state.last || this.state.last === null || this.state.last === "") validated = false;
|
||||
if (!this.state.password_validated || !this.state.pass || this.state.pass === null || this.state.pass === "") validated = false;
|
||||
if (!this.state.agreedTerms) validated = false;
|
||||
|
||||
this.setState(Object.assign(this.state, { validated: validated }));
|
||||
}
|
||||
|
||||
@@ -114,11 +111,6 @@ class SignUp extends React.Component {
|
||||
this.setState(Object.assign(this.state, { password_validated: this.state.pass === this.state.passConfirmation }));
|
||||
};
|
||||
|
||||
handleChecked = (event, checked) => {
|
||||
this.setState(Object.assign(this.state, { agreedTerms: checked }));
|
||||
this.buttonValidated();
|
||||
};
|
||||
|
||||
clickEvent = (event) => {
|
||||
event.preventDefault();
|
||||
const state = this;
|
||||
@@ -236,14 +228,6 @@ class SignUp extends React.Component {
|
||||
/>
|
||||
</div>
|
||||
<div className="divider" />
|
||||
<div className="form-group">
|
||||
<Checkbox
|
||||
label="Member has consented to terms of use"
|
||||
checked={this.state.agreedTerms}
|
||||
onCheck={this.handleChecked}
|
||||
/>
|
||||
</div>
|
||||
<div className="divider" />
|
||||
<div className="form-group">
|
||||
<p className="text-small">By clicking on sign up, you agree to <a href="javascript:;"><i>terms</i></a> and <a href="javascript:;"><i>privacy policy</i></a></p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user