Permalink
Browse files

Create Date objects with correct months

JavaScript's Date class expects 'month' to be 0-11.
  • Loading branch information...
jinwoo committed Sep 27, 2017
1 parent e9293d4 commit 422725fd10ca6f3a67892f3c90e157d24fd8de1e
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/org-mode-parser.js
View
@@ -460,17 +460,17 @@ var parseBigString=function (data){
if(scheduledStuff){
//debug("Matched:"+line);
// new Date(year, month, day, hours, minutes, seconds, ms)
sched_date= new Date(scheduledStuff[1], scheduledStuff[2],scheduledStuff[3],
sched_date= new Date(scheduledStuff[1], scheduledStuff[2] - 1,scheduledStuff[3],
0,0,0,0);
}
var deadlineStuff=line.match(deadlineRE);
if(deadlineStuff){
deadline_date= new Date(deadlineStuff[1], deadlineStuff[2],deadlineStuff[3],
deadline_date= new Date(deadlineStuff[1], deadlineStuff[2] - 1,deadlineStuff[3],
0,0,0,0);
}
var closedStuff=line.match(closedRE);
if(closedStuff){
closed_date= new Date(closedStuff[1], closedStuff[2],closedStuff[3],
closed_date= new Date(closedStuff[1], closedStuff[2] - 1,closedStuff[3],
0,0,0,0);
}
if(isAClockLine){

0 comments on commit 422725f

Please sign in to comment.