Closed am2367 closed 4 years ago
Thank you for this contribution. When the date select component appears if I click the small X that appears in that component I get the following error. Are you able to handle for this error? Also, do you have any thoughts as to how the copy should change if user's select their own date?
▶ 4 stack frames were collapsed.
getDateOf
src/util/dateHelpers.js:10
7 | }
8 |
9 | export function getDateOf(date): LocalDate {
> 10 | return LocalDate.parse(date);
11 | }
12 |
13 | export function getNextYear(date: LocalDate): number {
View compiled
App._this.dateHandler
src/App.js:27
24 | }
25 |
26 | dateHandler = (event) => {
> 27 | let date: LocalDate = getDateOf(event.target.value)
28 | this.daysUntilNextYear(date)
29 | }
30 |
View compiled
onChange
src/App.js:49
46 |
47 | {!checkNYE(this.state.daysUntilNextYear) ? (
48 | <div>
> 49 | <a>Date: </a><input type="date" id="date" defaultValue={this.state.date} min="2018-01-01" max="2018-12-31" onChange={(event)=>this.dateHandler(event)}></input>
50 | <p>
51 | It will be {this.state.nextYear} in {this.state.daysUntilNextYear} days!
52 | </p>
View compiled
▶ 18 stack frames were collapsed.
@M0nica Fixed the issue by checking for null and empty value passed in event handler. The user does currently have the option to change the date which you can feel free to test.
@M0nica Also fixed you linting issue in issue #9
Stale pull request message
Fixed issue #1 and #2