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

Loading…
Cancel
Save