/** * Created by knut on 15-01-14. */ var moment = require('moment') var Logger = require('../../logger') var log = Logger.Log var dateFormat = '' var title = '' var sections = [] var tasks = [] var currentSection = '' exports.clear = function () { sections = [] tasks = [] currentSection = '' title = '' taskCnt = 0 lastTask = undefined lastTaskID = undefined rawTasks = [] } exports.setDateFormat = function (txt) { dateFormat = txt } exports.getDateFormat = function () { return dateFormat } exports.setTitle = function (txt) { title = txt } exports.getTitle = function () { return title } exports.addSection = function (txt) { currentSection = txt sections.push(txt) } exports.getTasks = function () { var allItemsPricessed = compileTasks() var maxDepth = 10 var iterationCount = 0 while (!allItemsPricessed && (iterationCount < maxDepth)) { allItemsPricessed = compileTasks() iterationCount++ } tasks = rawTasks // var i; // for(i=10000;i