|
|
@ -55,9 +55,6 @@ function addPageSponsor({ |
|
|
|
imageUrl, |
|
|
|
imageUrl, |
|
|
|
adTitle, |
|
|
|
adTitle, |
|
|
|
adDescription, |
|
|
|
adDescription, |
|
|
|
startDate, |
|
|
|
|
|
|
|
endDate, |
|
|
|
|
|
|
|
isActive, |
|
|
|
|
|
|
|
}) { |
|
|
|
}) { |
|
|
|
const urlPart = pageUrl |
|
|
|
const urlPart = pageUrl |
|
|
|
.replace('https://roadmap.sh/', '') |
|
|
|
.replace('https://roadmap.sh/', '') |
|
|
@ -128,6 +125,9 @@ function addPageSponsor({ |
|
|
|
removeAllSponsors('roadmaps'); |
|
|
|
removeAllSponsors('roadmaps'); |
|
|
|
removeAllSponsors('best-practices'); |
|
|
|
removeAllSponsors('best-practices'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('------------------------'); |
|
|
|
|
|
|
|
console.log('Adding sponsors'); |
|
|
|
|
|
|
|
console.log('------------------------'); |
|
|
|
fetch(sheetUrl) |
|
|
|
fetch(sheetUrl) |
|
|
|
.then((res) => res.json()) |
|
|
|
.then((res) => res.json()) |
|
|
|
.then((rawData) => { |
|
|
|
.then((rawData) => { |
|
|
@ -149,7 +149,8 @@ fetch(sheetUrl) |
|
|
|
|
|
|
|
|
|
|
|
const isConfiguredActive = isActive?.toLowerCase() === 'yes'; |
|
|
|
const isConfiguredActive = isActive?.toLowerCase() === 'yes'; |
|
|
|
const currentDate = new Date(); |
|
|
|
const currentDate = new Date(); |
|
|
|
const isDateInRange = currentDate >= new Date(startDate) && currentDate <= new Date(endDate); |
|
|
|
const isDateInRange = |
|
|
|
|
|
|
|
currentDate >= new Date(startDate) && currentDate <= new Date(endDate); |
|
|
|
|
|
|
|
|
|
|
|
if (!isConfiguredActive || !isDateInRange) { |
|
|
|
if (!isConfiguredActive || !isDateInRange) { |
|
|
|
return; |
|
|
|
return; |
|
|
|