This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

add proper new resource check

+22 -7
+22 -7
src/components/Resources/Resources.js
··· 157 157 }, []); 158 158 159 159 // Check if a resource is new (added in the last 14 days) 160 - const isNewResource = (date) => { 161 - if (!date) return false; 162 - const resourceDate = new Date(date); 163 - const now = new Date(); 164 - const daysDiff = Math.floor((now - resourceDate) / (1000 * 60 * 60 * 24)); 165 - return daysDiff < 14; 166 - }; 160 + // Check if a resource is new (added in the last 14 days) 161 + const isNewResource = (date) => { 162 + if (!date) return false; 163 + 164 + const resourceDate = new Date(date); 165 + 166 + // Check if the resource was created on February 27, 2025 167 + const feb27Date = new Date('2025-02-27'); 168 + const isFeb27 = resourceDate.getFullYear() === feb27Date.getFullYear() && 169 + resourceDate.getMonth() === feb27Date.getMonth() && 170 + resourceDate.getDate() === feb27Date.getDate(); 171 + 172 + // If it was created on Feb 27, 2025, don't mark it as new 173 + if (isFeb27) { 174 + return false; 175 + } 176 + 177 + // Otherwise, apply the normal 14-day rule 178 + const now = new Date(); 179 + const daysDiff = Math.floor((now - resourceDate) / (1000 * 60 * 60 * 24)); 180 + return daysDiff < 14; 181 + }; 167 182 168 183 // Check if a resource impacts score 169 184 const impactsScore = (resource) => {