Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

parser: fix style

  • Loading branch information...
commit 263e7bfce9ed91a5851d7e329ce3d16fd94938e0 1 parent 3b4b5aa
@mscdex authored
Showing with 20 additions and 9 deletions.
  1. +20 −9 lib/parser.js
View
29 lib/parser.js
@@ -108,8 +108,11 @@ Parser.parseListEntry = function(line) {
hour = '0' + hour;
if (mins < 10)
mins = '0' + mins;
- info.date = new Date(year + '-' + month + '-' + day + 'T'
- + hour + ':' + mins);
+ info.date = new Date(year + '-'
+ + month + '-'
+ + day + 'T'
+ + hour + ':'
+ + mins);
// If the date is in the past but no more than 6 months old, year
// isn't displayed and doesn't have to be the current year.
//
@@ -121,10 +124,14 @@ Parser.parseListEntry = function(line) {
//
// If we're here with a time that is more than 28 hours into the
// future (1 hour + maximum timezone offset which is 27 hours),
- // there is a problem : we should be in the second conditional block
- if(info.date.getTime()-new Date().getTime() > 100800000)
- info.date = new Date((year-1) + '-' + month + '-' + day + 'T'
- + hour + ':' + mins);
+ // there is a problem -- we should be in the second conditional block
+ if (info.date.getTime() - Date.now() > 100800000) {
+ info.date = new Date((year - 1) + '-'
+ + month + '-'
+ + day + 'T'
+ + hour + ':'
+ + mins);
+ }
// If we're here with a time that is more than 6 months old, there's
// a problem as well.
@@ -135,9 +142,13 @@ Parser.parseListEntry = function(line) {
// 01/01/14 02:23
// Our trigger point will be 3600*24*31*6 (since we already use 31
// as an upper bound, no need to add the 27 hours timezone offset)
- if(new Date().getTime()-info.date.getTime() > 16070400000)
- info.date = new Date((year+1) + '-' + month + '-' + day + 'T'
- + hour + ':' + mins);
+ if (Date.now() - info.date.getTime() > 16070400000) {
+ info.date = new Date((year + 1) + '-'
+ + month + '-'
+ + day + 'T'
+ + hour + ':'
+ + mins);
+ }
} else if (ret.month2 !== undefined) {
month = parseInt(MONTHS[ret.month2.toLowerCase()], 10);
day = parseInt(ret.date2, 10);
Please sign in to comment.
Something went wrong with that request. Please try again.