M0nica / how-many-days-until

A React countdown app of days between today and next year.
https://m0nica.github.io/how-many-days-until/
10 stars 32 forks source link

Adds Title and gives user ability to change date for 2018 year. Fixes linting issues. #7

Closed am2367 closed 4 years ago

am2367 commented 5 years ago

Fixed issue #1 and #2

M0nica commented 5 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.
am2367 commented 5 years ago

@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.

am2367 commented 5 years ago

@M0nica Also fixed you linting issue in issue #9

github-actions[bot] commented 4 years ago

Stale pull request message