From 3a21a0d4a801b61d21eb431ea005e3dab4415482 Mon Sep 17 00:00:00 2001 From: Chase Pursley Date: Wed, 22 Apr 2015 19:20:16 -0400 Subject: [PATCH 1/4] Grammar --- chapters/dates_and_times/days-between-two-dates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/dates_and_times/days-between-two-dates.md b/chapters/dates_and_times/days-between-two-dates.md index 11f6894..5b923cb 100644 --- a/chapters/dates_and_times/days-between-two-dates.md +++ b/chapters/dates_and_times/days-between-two-dates.md @@ -5,7 +5,7 @@ chapter: Dates and Times --- ## Problem -You need to find how much seconds minutes, hours, days, months or years has passed between two dates. +You need to find how many seconds minutes, hours, days, months or years has passed between two dates. ## Solution From fa3720bc1b2274608900255bfb8e2ff4d75be419 Mon Sep 17 00:00:00 2001 From: Chase Pursley Date: Wed, 22 Apr 2015 19:21:41 -0400 Subject: [PATCH 2/4] Grammar 2 --- chapters/dates_and_times/days-between-two-dates.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/chapters/dates_and_times/days-between-two-dates.md b/chapters/dates_and_times/days-between-two-dates.md index 5b923cb..def2cc3 100644 --- a/chapters/dates_and_times/days-between-two-dates.md +++ b/chapters/dates_and_times/days-between-two-dates.md @@ -22,12 +22,10 @@ days_passed = Math.round((d2.getTime() - d1.getTime()) / DAY) ## Discussion -Using milliseconds makes the life easier to avoid overflow mistakes with Dates. So we first calculate how much milliseconds has a day. -Then, given two distinct dates, just get the difference in milliseconds between two dates and then divide by how much milliseconds has a -day. It will get you the days between two distinct dates. +Using milliseconds makes the life easier to avoid overflow mistakes with Dates. So we first calculate how many milliseconds are in a day. +Then, given two distinct dates, just get the difference in milliseconds between two dates and then divide by how many milliseconds are in a day. It will return the days between two distinct dates. -If you'd like to calculate the hours between two date objects, you can do that just by dividing the difference in milliseconds by the -conversion of milliseconds to hours. The same goes for minutes and seconds. +If you'd like to calculate the hours between two date objects, you can do that just by dividing the difference in milliseconds by the conversion of milliseconds to hours. The same goes for minutes and seconds. {% highlight coffeescript %} HOUR = 1000 * 60 * 60 From 23520f84a33023d13426ae43699e97caa17eec4d Mon Sep 17 00:00:00 2001 From: Chase Pursley Date: Sat, 25 Apr 2015 12:23:17 -0400 Subject: [PATCH 3/4] Add comma --- chapters/dates_and_times/days-between-two-dates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/dates_and_times/days-between-two-dates.md b/chapters/dates_and_times/days-between-two-dates.md index def2cc3..d70408f 100644 --- a/chapters/dates_and_times/days-between-two-dates.md +++ b/chapters/dates_and_times/days-between-two-dates.md @@ -5,7 +5,7 @@ chapter: Dates and Times --- ## Problem -You need to find how many seconds minutes, hours, days, months or years has passed between two dates. +You need to find how many seconds, minutes, hours, days, months or years has passed between two dates. ## Solution From 8942bab7bd05eafb1f0afb626b5f73cde9cfe02c Mon Sep 17 00:00:00 2001 From: Chase Pursley Date: Sat, 25 Apr 2015 12:24:48 -0400 Subject: [PATCH 4/4] A few other grammar changes --- chapters/dates_and_times/days-between-two-dates.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chapters/dates_and_times/days-between-two-dates.md b/chapters/dates_and_times/days-between-two-dates.md index d70408f..b6a94e9 100644 --- a/chapters/dates_and_times/days-between-two-dates.md +++ b/chapters/dates_and_times/days-between-two-dates.md @@ -5,11 +5,11 @@ chapter: Dates and Times --- ## Problem -You need to find how many seconds, minutes, hours, days, months or years has passed between two dates. +You need to find how many seconds, minutes, hours, days, months or years have passed between two dates. ## Solution -Use JavaScript's Date function getTime(). Which provides how much time in milliseconds has passed since 01/01/1970: +Use JavaScript's Date function getTime(). Which provides how much time in milliseconds have passed since 01/01/1970: {% highlight coffeescript %} DAY = 1000 * 60 * 60 * 24 @@ -23,9 +23,9 @@ days_passed = Math.round((d2.getTime() - d1.getTime()) / DAY) ## Discussion Using milliseconds makes the life easier to avoid overflow mistakes with Dates. So we first calculate how many milliseconds are in a day. -Then, given two distinct dates, just get the difference in milliseconds between two dates and then divide by how many milliseconds are in a day. It will return the days between two distinct dates. +Then, given two distinct dates, get the difference in milliseconds between two dates and then divide by how many milliseconds are in a day. It will return the days between two distinct dates. -If you'd like to calculate the hours between two date objects, you can do that just by dividing the difference in milliseconds by the conversion of milliseconds to hours. The same goes for minutes and seconds. +If you'd like to calculate the hours between two date objects, you can do that by dividing the difference in milliseconds by the conversion of milliseconds to hours. The same goes for minutes and seconds. {% highlight coffeescript %} HOUR = 1000 * 60 * 60