1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 02:19:34 +05:30

(refactor): switched to auto age and yoe calculation and improved load time by replacing render blocking scripts

This commit is contained in:
2024-04-02 14:26:20 +05:30
parent d0b8ac6841
commit 40f690db92
6 changed files with 17 additions and 8 deletions

View File

@@ -0,0 +1,10 @@
//---JS utility functions
// function to calculate the year difference between the given date and the current date
function calculateYearDiff(date) {
let givenDate = new Date(date);
let currentDate = new Date();
let timeDiff = currentDate.getTime() - givenDate.getTime();
let years = Math.floor(timeDiff / (1000 * 3600 * 24 * 365.25));
return years;
}