From b5b721c027c2e5a2b79fcc55522ee33fd8d68a80 Mon Sep 17 00:00:00 2001 From: Zach Wise Date: Tue, 15 May 2012 17:35:52 -0500 Subject: [PATCH] Date parse debugging --- source/js/VMM.Timeline.js | 21 ++++++++++++--------- source/js/VMM.Util.js | 4 +++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/source/js/VMM.Timeline.js b/source/js/VMM.Timeline.js index 62d54cc..1a53d8f 100755 --- a/source/js/VMM.Timeline.js +++ b/source/js/VMM.Timeline.js @@ -436,14 +436,17 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { _date.enddate = _date.startdate; } - _date.title = data.date[i].headline; - _date.headline = data.date[i].headline; - _date.type = data.date[i].type; - _date.date = VMM.Util.date.prettyDate(_date.startdate); - _date.asset = data.date[i].asset; - _date.fulldate = _date.startdate.getTime(); - _date.text = data.date[i].text; - _date.content = ""; + _date.title = data.date[i].headline; + _date.headline = data.date[i].headline; + _date.type = data.date[i].type; + _date.date = VMM.Util.date.prettyDate(_date.startdate); + _date.startdate_str = VMM.Util.date.prettyDate(_date.startdate); + _date.enddate_str = VMM.Util.date.prettyDate(_date.enddate); + _date.asset = data.date[i].asset; + _date.fulldate = _date.startdate.getTime(); + _date.text = data.date[i].text; + _date.content = ""; + _dates.push(_date); @@ -464,7 +467,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { var _date = {}; var td_num = 0; var td = _dates[0].startdate; - _date.startdate = _dates[0].startdate; + _date.startdate = new Date(_dates[0].startdate); trace(_dates[0].startdate); trace(_date.startdate); diff --git a/source/js/VMM.Util.js b/source/js/VMM.Util.js index 2523c78..4ea9adb 100644 --- a/source/js/VMM.Util.js +++ b/source/js/VMM.Util.js @@ -187,6 +187,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') { var _d_array; // DATE ARRAY var _t_array; // TIME ARRAY if ( d.match(/,/gi) ) { + trace("DATE HAS ,"); _d_array = d.split(","); for(var i = 0; i < _d_array.length; i++) { _d_array[i] = parseInt(_d_array[i]); @@ -199,6 +200,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') { if ( _d_array[5] > 1 ) { _date.setSeconds( _d_array[5]); } if ( _d_array[6] > 1 ) { _date.setMilliseconds( _d_array[6]); } } else if (d.match("/")) { + trace("DATE HAS /"); var _time_parse; var _times; if (d.match(" ")) { @@ -225,7 +227,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') { _date.setMinutes(0); _date.setSeconds(0); _date.setMilliseconds(0); - }else { + } else { _date = new Date( parseInt(d.slice(0,4)), parseInt(d.slice(4,6)) - 1,