Skip to content

Commit

Permalink
valid age range now pulls from startdate in defaults.js (#595)
Browse files Browse the repository at this point in the history
* valid age range now pulls from startdate in defaults.jsu

* Minor corrections

---------

Co-authored-by: Kevin Monisit <[email protected]>
  • Loading branch information
avsomers25 and kevinmonisit committed Oct 4, 2023
1 parent a886edb commit 2a3e5cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
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

0 comments on commit 2a3e5cc

Please sign in to comment.