Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valid age range now pulls from startdate in defaults.js #595

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Footer from "./components/Landing/Sections/Footer";
const defaults = {
title: "HackRU Fall 2023",
dateText: "February 25th - 26th, 2023",
startdate: "10/7/2023",
locationText: "Rutgers College Ave Student Center",
universityText: "Rutgers University",
slogan: "hack all knight",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AvForm, AvField } from "availity-reactstrap-validation";
import Select, { Creatable } from "react-select";
import CustomAVInput from "../CustomAVInput";
import { Icon } from "react-fa";
import { theme } from "../../../../../Defaults";
import { theme, defaults } from "../../../../../Defaults";
import selectorOptions from "../selectorOptions.json";
import { ProfileType } from "../../../../Profile";
import PropTypes from "prop-types";
Expand All @@ -14,8 +14,8 @@ import countryList from "react-select-country-list";


class About extends Component {
// constructor(props) {npm
// super(props);
// constructor(props) {
// super(props
// this.updateUser = this.updateUser.bind(this);
// }
UNSAFE_componentWillMount() {
Expand Down Expand Up @@ -53,7 +53,6 @@ class About extends Component {
update_user.ethnicity = this.state.user.ethnicity;
update_user.hackathon_count = this.state.user.hackathon_count;
update_user.country_of_residence = this.state.user.country_of_residence;

this.props.profile.Set(update_user)
.then(res => {
this.setState({
Expand All @@ -72,6 +71,8 @@ class About extends Component {
if (this.state.message) {
message = (<UncontrolledAlert color="danger">{this.state.message}</UncontrolledAlert>);
}
let tempDate = new Date(defaults.startdate);
tempDate.setFullYear((tempDate.getFullYear()) - 18);
if (this.state.edit) {
return (
<AvForm
Expand Down Expand Up @@ -139,10 +140,9 @@ class About extends Component {
value: "01/01/1920"
},
end: {
value: "02/25/2005"
value: tempDate.toLocaleDateString()
}
}
}} />
} }} />
</Col>
<Col xs={(mobile) ? 12 : 4}>
<CustomAVInput name="size"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Select, { Creatable, AsyncCreatable } from "react-select";
import ResumeUploader from "./ResumeUploader";
import CustomAVInput from "./CustomAVInput";
import { Icon } from "react-fa";
import { theme } from "../../../../Defaults";
import { theme, defaults } from "../../../../Defaults";
import request from "request";
import majors from "./majors.json";
import selectorOptions from "./selectorOptions.json";
Expand Down Expand Up @@ -47,6 +47,9 @@ class UserProfileForm extends Component {
this.props.onChange(user);
}
render() {
let tempDate = new Date(defaults.startdate);
tempDate.setFullYear((tempDate.getFullYear()) - 18);

let mobile = this.props.mobile;
let user = this.state.user;
let mlhnotices = [];
Expand Down Expand Up @@ -133,7 +136,7 @@ class UserProfileForm extends Component {
value: "01/01/1920"
},
end: {
value: "10/07/2005"
value: tempDate.toLocaleDateString()
}
} }} />
</Col>
Expand Down
Loading