Skip to content

Commit

Permalink
Remvoe ganttDb getDateFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Mar 13, 2018
1 parent 7df9dea commit 7ef1b28
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/diagrams/gantt/ganttDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ export const setDateFormat = function (txt) {
dateFormat = txt
}

export const getDateFormat = function () {
return dateFormat
}
export const setTitle = function (txt) {
title = txt
}
Expand Down Expand Up @@ -150,7 +147,6 @@ const compileData = function (prevTask, dataStr) {
const data = ds.split(',')

const task = {}
const df = getDateFormat()

// Get tags like active, done cand crit
let matchFound = true
Expand Down Expand Up @@ -180,17 +176,17 @@ const compileData = function (prevTask, dataStr) {
case 1:
task.id = parseId()
task.startTime = prevTask.endTime
task.endTime = getEndDate(task.startTime, df, data[0])
task.endTime = getEndDate(task.startTime, dateFormat, data[0])
break
case 2:
task.id = parseId()
task.startTime = getStartDate(undefined, df, data[0])
task.endTime = getEndDate(task.startTime, df, data[1])
task.startTime = getStartDate(undefined, dateFormat, data[0])
task.endTime = getEndDate(task.startTime, dateFormat, data[1])
break
case 3:
task.id = parseId(data[0])
task.startTime = getStartDate(undefined, df, data[1])
task.endTime = getEndDate(task.startTime, df, data[2])
task.startTime = getStartDate(undefined, dateFormat, data[1])
task.endTime = getEndDate(task.startTime, dateFormat, data[2])
break
default:
}
Expand Down Expand Up @@ -308,8 +304,6 @@ export const addTaskOrg = function (descr, data) {
}

const compileTasks = function () {
const df = getDateFormat()

const compileTask = function (pos) {
const task = rawTasks[pos]
let startTime = ''
Expand All @@ -319,15 +313,15 @@ const compileTasks = function () {
task.startTime = prevTask.endTime
break
case 'getStartDate':
startTime = getStartDate(undefined, df, rawTasks[pos].raw.startTime.startData)
startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData)
if (startTime) {
rawTasks[pos].startTime = startTime
}
break
}

if (rawTasks[pos].startTime) {
rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, df, rawTasks[pos].raw.endTime.data)
rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data)
if (rawTasks[pos].endTime) {
rawTasks[pos].processed = true
}
Expand All @@ -348,7 +342,6 @@ const compileTasks = function () {
export default {
clear,
setDateFormat,
getDateFormat,
setTitle,
getTitle,
addSection,
Expand Down

0 comments on commit 7ef1b28

Please sign in to comment.