Skip to content

Commit bff25f0

Browse files
committed
Corrected date format
1 parent f9e7660 commit bff25f0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

client/src/components/add-student/AddStudent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ export default class AddStudent extends Component {
102102
}
103103

104104
render() {
105-
106105
return (this.state.loading) ? <MyLoader loading={this.state.loading} /> :
107106
<AuthContext.Consumer>
108107
{context => (
109108
<div className="d-lg-flex border justify-content-center p-3">
109+
<h3>Add New Student</h3>
110110
<form onSubmit={this.handleAddForm}>
111111
<div className="row py-3">
112112
<div className="col">
@@ -147,7 +147,7 @@ export default class AddStudent extends Component {
147147
<div className="form-group">
148148
<label htmlFor="InputDate">Date Of Joining </label>
149149
<i className="far fa-calendar-alt ml-2 mr-4 mb-2 btn-lg" id="InputDate" onClick={this.openModal} />
150-
<span>Selected Date:- {this.state.date.toLocaleDateString()}</span>
150+
<span>Selected Date:- {this.state.date.toLocaleString('en-IN').split(',')[0]}</span>
151151
</div>
152152
<div>
153153
<h5>Last Year Marks</h5>

client/src/components/fees/Fee.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const Fee = (props) => {
188188
<input type="tel" onChange={e=> setAmount(e.target.value)} className='form-control form-control-sm' name="installment" required/>
189189
<label htmlFor="date">Date</label>
190190
<i className="far fa-calendar-alt btn-lg" id="date" onClick={openModal}></i>
191-
<p>Selected Date:- {date.toLocaleDateString()}</p>
191+
<p>Selected Date:- {date.toLocaleString('en-IN').split(',')[0]}</p>
192192
</div>
193193
<input type="submit" className='btn btn-sm btn-light mt-3' value="Add Installment"/>
194194
</form>

client/src/context.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export class AuthProvider extends Component{
77
this.state={
88
isAuth: false,
99
user: '',
10-
selectedForEdit: {}
10+
selectedForEdit: {},
11+
students: []
1112
}
1213
}
1314

@@ -26,6 +27,7 @@ export class AuthProvider extends Component{
2627
}
2728
}
2829

30+
2931
handleLogout = (e)=>{
3032
e.preventDefault();
3133
this.setState({isAuth:false})
@@ -66,5 +68,3 @@ export class AuthProvider extends Component{
6668
)
6769
}
6870
}
69-
70-
// export {AuthContext,AuthProvider}

0 commit comments

Comments
 (0)