feat: parse timeToEnd from excel

This commit is contained in:
Carlos Valente
2024-12-16 10:38:52 +01:00
committed by Carlos Valente
parent 0f3feca7ab
commit df1cf7a96b
6 changed files with 33 additions and 7 deletions
+7 -1
View File
@@ -110,6 +110,7 @@ export const parseExcel = (
// options: booleans
let isPublicIndex: number | null = null;
let skipIndex: number | null = null;
let isTimeToEndIndex: number | null = null;
let linkStartIndex: number | null = null;
@@ -159,6 +160,10 @@ export const parseExcel = (
titleIndex = col;
rundownMetadata['title'] = { row, col };
},
[importMap.isTimeToEnd]: (row: number, col: number) => {
isTimeToEndIndex = col;
rundownMetadata['isTimeToEnd'] = { row, col };
},
[importMap.isPublic]: (row: number, col: number) => {
isPublicIndex = col;
rundownMetadata['isPublic'] = { row, col };
@@ -226,6 +231,8 @@ export const parseExcel = (
event.duration = parseExcelDate(column);
} else if (j === cueIndex) {
event.cue = makeString(column, '');
} else if (j === isTimeToEndIndex) {
event.isTimeToEnd = parseBooleanString(column);
} else if (j === isPublicIndex) {
event.isPublic = parseBooleanString(column);
} else if (j === skipIndex) {
@@ -271,7 +278,6 @@ export const parseExcel = (
// if any data was found in row, push to array
const keysFound = Object.keys(event).length + Object.keys(eventCustomFields).length;
console.log('keys found ---->', event)
if (keysFound > 0) {
// if it is a Block type drop all other filed
if (isOntimeBlock(event)) {