Minor update

pull/3752/head
Kamran Ahmed 2 years ago
parent d21c1f6d0d
commit caf1cd0269
  1. 9
      bin/update-sponsors.cjs

@ -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;

Loading…
Cancel
Save