diff --git a/app/functions-owners.js b/app/functions-owners.js index 457d44c..d44dab1 100644 --- a/app/functions-owners.js +++ b/app/functions-owners.js @@ -1,34 +1,35 @@ -const periods = ['December 2018', 'January 2019']; +const periods = ['December 2018', 'January 2019'], + effDt = new Date('2018-12-29'); const urls = { 'CAROLINA LOGISTICS, Inc': { id: '70830516181943', period1: 'https://docs.google.com/spreadsheets/d/1LHkvGzcVTqjcnjTsZhBPhW2Y_OVdsjE0Gmob6ni8GWU/edit#gid=1165085359', - period2: '#', + period2: 'https://docs.google.com/spreadsheets/d/1Yz7-XCIduFjAkC0viz6Vyb4YivWlkLe92VGR45hgdPU/edit#gid=1165085359', }, 'DELTA EXPRESS, Inc': { id: '70830515177576', period1: 'https://docs.google.com/spreadsheets/d/1xRLKG4LWLJ9GbFIvkF1UIY9kkXiq4ScAwl7sO1RFCHk/edit#gid=1165085359', - period2: '#', + period2: 'https://docs.google.com/spreadsheets/d/1m20SlaOddjd449cbF6SpdC7k5x-ZCB4WZ6U_loi6pMo/edit#gid=1165085359', }, 'DELTA LOGISTICS, Inc': { id: '70830517302592', period1: 'https://docs.google.com/spreadsheets/d/1Wa55QZVf228iss4qS-wmKJYZkS9tOWL_YzAQlJowGuY/edit#gid=1165085359', - period2: '#', + period2: 'https://docs.google.com/spreadsheets/d/1vTfiX18K4Rb0sffwyDo2Y62Tms6XnLRB6TV1Fnzh4cE/edit#gid=1165085359', }, 'ONTRACK TRANSPORTATION, Inc': { id: '70830517305886', period1: 'https://docs.google.com/spreadsheets/d/19QlNjRTd2IoXwiuQrw_Rm_GiuozJG0Z5ie_rLfTJVtA/edit#gid=1165085359', - period2: '#', + period2: 'https://docs.google.com/spreadsheets/d/1tqb5F5jq-95UV_yCHW4jJbxv83tM6BqaTwyb2EyjNcM/edit#gid=1165085359', }, 'PRECISE TRANSPORTATION, Inc': { id: '70830517302433', period1: 'https://docs.google.com/spreadsheets/d/1i57ZntMon-Yb6eZ7PqdnUthknyS0IFS-Oqp_sZiAE_I/edit#gid=1165085359', - period2: '#', + period2: 'https://docs.google.com/spreadsheets/d/1ROBjlyWa0eVmYcX-0_FEYJ0sYTMv7pBd-1Bl1O0PjD8/edit#gid=1165085359', }, 'RAINIER TRANSPORTATION, Inc': { id: '70830517307425', - period1: '#', - period2: '#', + period1: '-', + period2: '-', }, }; const pad = 'style="padding: 14px 45px;"'; @@ -36,10 +37,14 @@ let table = 'Company NamePerio keys = Object.keys(urls); for (let i = 0; i < keys.length; i++) { let link1 = urls[keys[i]].period1, link2 = urls[keys[i]].period2, - anchor1 = '', - anchor2 = '', - anchName1 = (link1 != '#') ? periods[0] + '' : '' + periods[0], - anchName2 = (link2 != '#') ? periods[1] + '' : '' + periods[1]; + anchor1 = (link1 != '-') ? '' : '', + anchor2 = (link2 != '-') ? '' : '', + anchName1 = (link1 == '-') ? '' : + (link1 != '#') ? periods[0] + '' : + '' + periods[0], + anchName2 = (link2 == '-') ? '' : + (link2 != '#' && effDt <= new Date()) ? periods[1] + '' : + '' + periods[1]; table += '' + keys[i] + '  ' + urls[keys[i]].id + ''; table += '' + anchor1 + anchName1 + '' + anchor2 + anchName2 + ''; }