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

Fix moment.js deprecation warning #53

Merged
merged 1 commit into from
Oct 19, 2017
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ yarn-debug.log*
yarn-error.log*
.vscode/launch.json
package-lock.json

.idea/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure it can't hurt!

what is this for, out of curiosity :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using IDE from JetBrains (I use WebStorm for web stack) - the IDE put own files into .idea path. It is unnecessary put those files into repository. This row hide path and subfiles for GIT version control system

6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class App extends Component {

let newExcludedDatesData = this.state.calculatorInfo.data;
const newExcludedDate = {
date: this.state.newExclusionDate.format("MM/DD/YYYY"),
date: this.state.newExclusionDate.format("YYYY-MM-DD"),
reason: this.state.newExclusionReason,
};
newExcludedDatesData.push(newExcludedDate);
Expand Down Expand Up @@ -235,7 +235,7 @@ class App extends Component {
key={item.date}
onMouseEnter={this.updateHoverDate.bind(this, item.date, true)}
onMouseLeave={this.updateHoverDate.bind(this, item.date, false)}>
<ExcludedData>{item.date}</ExcludedData>
<ExcludedData>{moment(item.date).format("MM/DD/YYYY")}</ExcludedData>
<ExcludedData>{item.reason}</ExcludedData>
<ExcludedData><div
className={["trash animated", this.state.hoverDate === item.date ? "trash-show rotateIn" : ""].join(" ")}
Expand Down Expand Up @@ -281,7 +281,7 @@ class App extends Component {
{ this.state.result &&
<ResultContent>
<Date>
{moment(this.state.result, 'MM-DD-YYYY').format('dddd, MMMM Do YYYY')}
{moment(this.state.result, 'YYYY-MM-DD').format('dddd, MMMM Do YYYY')}
</Date>
<Date className="Date">{this.state.result}</Date>
</ResultContent>
Expand Down
46 changes: 23 additions & 23 deletions src/excluded_dates.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"title": "Chelsea High School School Working Day Calculator",
"data": [
{ "date": "10/23/2017", "reason": "Teacher Day - No School" },
{ "date": "11/22/2017", "reason": "Thanksgiving Recess" },
{ "date": "11/23/2017", "reason": "Thanksgiving Recess" },
{ "date": "11/24/2017", "reason": "Thanksgiving Recess" },
{ "date": "12/25/2017", "reason": "December Recess" },
{ "date": "12/26/2017", "reason": "December Recess" },
{ "date": "12/27/2017", "reason": "December Recess" },
{ "date": "12/28/2017", "reason": "December Recess" },
{ "date": "12/29/2017", "reason": "December Recess" },
{ "date": "1/1/2018", "reason": "New Year's Day - No School" },
{ "date": "1/15/2018", "reason": "MLK Day - No School" },
{ "date": "2/19/18", "reason": "Winter Recess" },
{ "date": "2/20/2018", "reason": "Winter Recess" },
{ "date": "2/21/18", "reason": "Winter Recess" },
{ "date": "2/22/2018", "reason": "Winter Recess" },
{ "date": "2/23/2018", "reason": "Winter Recess" },
{ "date": "3/30/2018", "reason": "Good Friday - No School" },
{ "date": "4/16/2018", "reason": "Spring Recess" },
{ "date": "4/17/2018", "reason": "Spring Recess" },
{ "date": "4/18/2018", "reason": "Spring Recess" },
{ "date": "4/19/2018", "reason": "Spring Recess" },
{ "date": "4/20/2018", "reason": "Spring Recess" },
{ "date": "5/28/2017", "reason": "Memorial Day - No School" }
{ "date": "2017-10-23", "reason": "Teacher Day - No School" },
{ "date": "2017-11-22", "reason": "Thanksgiving Recess" },
{ "date": "2017-11-23", "reason": "Thanksgiving Recess" },
{ "date": "2017-11-24", "reason": "Thanksgiving Recess" },
{ "date": "2017-12-25", "reason": "December Recess" },
{ "date": "2017-12-26", "reason": "December Recess" },
{ "date": "2017-12-27", "reason": "December Recess" },
{ "date": "2017-12-28", "reason": "December Recess" },
{ "date": "2017-12-29", "reason": "December Recess" },
{ "date": "2018-01-01", "reason": "New Year's Day - No School" },
{ "date": "2018-01-15", "reason": "MLK Day - No School" },
{ "date": "2018-02-19", "reason": "Winter Recess" },
{ "date": "2018-02-20", "reason": "Winter Recess" },
{ "date": "2018-02-21", "reason": "Winter Recess" },
{ "date": "2018-02-22", "reason": "Winter Recess" },
{ "date": "2018-02-23", "reason": "Winter Recess" },
{ "date": "2018-03-30", "reason": "Good Friday - No School" },
{ "date": "2018-04-16", "reason": "Spring Recess" },
{ "date": "2018-04-17", "reason": "Spring Recess" },
{ "date": "2018-04-18", "reason": "Spring Recess" },
{ "date": "2018-04-19", "reason": "Spring Recess" },
{ "date": "2018-04-20", "reason": "Spring Recess" },
{ "date": "2018-05-28", "reason": "Memorial Day - No School" }
]
}