Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

year automatically update #3341

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Licensing.html
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,6 @@ <h4 class="title custom-margin">Contact Us</h4>
});
});
</script>

<script src="./assets/js/year.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,7 @@ <h4 class="title custom-margin">Contact Us</h4>
<script src="./assets/js/botpress.js"></script>
<script src="./assets/js/blogmodals.js"></script>
<script src="./tools/smoothScroll.js"></script>
<script src="./assets/js/year.js"></script>
</body>

</html>
4 changes: 4 additions & 0 deletions assets/js/year.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const copyright_year = document.getElementById('copyright-year');
const year = new Date().getFullYear();

copyright_year.innerText = year;
2 changes: 1 addition & 1 deletion blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ <h4 class="title custom-margin">Contact Us</h4>
});
</script>


<script src="./assets/js/year.js"></script>
</body>

</head>
Expand Down
2 changes: 1 addition & 1 deletion blogs/privacy-policy.html
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,6 @@ <h4 class="title">Contact Us</h4>
updateWeekly();
});
</script>

<script src="./assets/js/year.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions blogs/refund-policy.html
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ <h4 class="title custom-margin">Contact Us</h4>
}

</style>
<script src="./assets/js/year.js"></script>
</body>

</html>
2 changes: 1 addition & 1 deletion blogs/terms-of-service.html
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ <h4 class="title">Contact Us</h4>
updateWeekly();
});
</script>

<script src="./assets/js/year.js"></script>
</body>

</html>
1 change: 1 addition & 0 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,7 @@ <h4 class="title custom-margin">Contact Us</h4>
<script src="https://mediafiles.botpress.cloud/5e160793-5606-4412-ba4c-337e416f14fe/webchat/config.js" defer></script>
<script defer src="./assets/js/arthsathi-style.js"></script>
<script src="./assets/js/botpress.js"></script>
<script src="./assets/js/year.js"></script>

<script>
// Get the modals
Expand Down
2 changes: 1 addition & 1 deletion contributors.html
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ <h4 class="title custom-margin">Contact Us</h4>

});
</script>

<script src="./assets/js/year.js"></script>
</body>


Expand Down
3 changes: 1 addition & 2 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -1621,8 +1621,7 @@ <h4 class="title custom-margin">Contact Us</h4>
<script src="./assets/js/botpress.js"></script>
<script src="./assets/js/blogmodals.js"></script>
<script src="./tools/smoothScroll.js"></script>

</head>
<script src="./assets/js/year.js"></script>
</body>

</html>
1 change: 1 addition & 0 deletions finance.html
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ <h4 class="title custom-margin">Contact Us</h4>
</script>

<script src="finance.js"></script>
<script src="./assets/js/year.js"></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
AOS.init({
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3037,7 +3037,7 @@ <h4 class="title custom-margin">Contact Us</h4>
defer></script>
<script defer src="./assets/js/arthsathi-style.js"></script>
<script src="./assets/js/botpress.js"></script>

<script src="./assets/js/year.js"></script>
<script>

document.getElementById("unique-subscribe-form").addEventListener("submit", function (event) {
Expand Down
1 change: 1 addition & 0 deletions maps.html
Original file line number Diff line number Diff line change
Expand Up @@ -1283,5 +1283,6 @@ <h4 class="title custom-margin">Contact Us</h4>
});

</script>
<script src="./assets/js/year.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ <h4 class="title custom-margin">Contact Us</h4>
</script>

</script>

<script src="./assets/js/year.js"></script>

</body>

Expand Down
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"mongoose": "^8.8.0",
"multer": "^1.4.5-lts.1",
"nodemailer": "^6.9.16",
"nodemon": "^3.1.7"
"nodemon": "^3.1.7",
"server": "file:"
}
}
117 changes: 45 additions & 72 deletions tools/RDCalculator.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,48 @@
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("calculate-Btn3").addEventListener("click", function() {
const monthlyInstallment = parseFloat(document.getElementById("monthly-installment").value);
const annualInterestRate = parseFloat(document.getElementById("rate1").value);
const timePeriodMonths = parseFloat(document.getElementById("months1").value);

// Clear previous error messages
clearErrorMessages();

// Validate inputs and display errors if any
const hasError = validateInputs(monthlyInstallment, annualInterestRate, timePeriodMonths);
if (hasError) return;

const monthlyInterestRate = annualInterestRate / 12 / 100;
let maturityAmount = 0;

for (let i = 0; i < timePeriodMonths; i++) {
maturityAmount += monthlyInstallment * Math.pow((1 + monthlyInterestRate), (timePeriodMonths - i));
}

const totalInvestAmount = monthlyInstallment * timePeriodMonths;
const interestEarned = maturityAmount - totalInvestAmount;

const formatter = new Intl.NumberFormat('en-IN', {
style: 'currency',
currency: 'INR'
});

// Display formatted results
document.getElementById("interestEarned1").innerText = `Interest Earned: ${formatter.format(interestEarned)}`;
document.getElementById("maturityAmount1").innerText = `Maturity Amount: ${formatter.format(maturityAmount)}`;
});

document.getElementById("clearBtn2").addEventListener("click", function() {
clearInputs();
});

function validateInputs(monthlyInstallment, annualInterestRate, timePeriodMonths) {
let hasError = false;

if (isNaN(monthlyInstallment) || monthlyInstallment <= 0) {
showError('installmentError', 'Please enter a valid positive number for the monthly installment.');
hasError = true;
}
if (isNaN(annualInterestRate) || annualInterestRate <= 0) {
showError('rateError', 'Please enter a valid positive number for the annual interest rate.');
hasError = true;
}
if (isNaN(timePeriodMonths) || timePeriodMonths <= 0) {
showError('monthsError', 'Please enter a valid positive number for the time period in months.');
hasError = true;
}

return hasError;
function calculateRD() {
let amount = parseFloat(document.getElementById("monthly-installment").value);
let rate = parseFloat(document.getElementById("rate1").value) / 100;
let time = parseFloat(document.getElementById("months").value) / 12;
let n = 12;

let maturity = amount * ((Math.pow(1 + (rate / n), n * time) - 1) / (1 - Math.pow(1 + (rate / n), -1)));

let totalInvestment = amount * (time * 12);
let interestEarned = maturity - totalInvestment;

document.getElementById("interestEarned1").innerText = interestEarned.toFixed(2);
document.getElementById("maturityAmount1").innerText = maturity.toFixed(2);


console.log('all done')
}

function clearFields() {
document.getElementById("monthly-installment").value = "";
document.getElementById("rate1").value = "";
document.getElementById("months").value = "";
document.getElementById('calculate-rd').disabled = true
document.getElementById("interestEarned1").innerText = '';
document.getElementById("maturityAmount1").innerText = '';

}


function disable() {
let amount =document.getElementById("monthly-installment").value;
let rate = document.getElementById("rate1").value;
let time = document.getElementById("months").value;
let calculate_rd_button = document.getElementById('calculate-rd');
if (amount.length < 1 ||rate.length < 1 || time.length < 1) {
calculate_rd_button.disabled = true
} else {
calculate_rd_button.disabled = false
}

}

function showError(elementId, message) {
document.getElementById(elementId).textContent = message;
}
document.getElementById('clear').addEventListener('click', clearFields)
document.getElementById('calculate-rd').addEventListener('click', calculateRD)

function clearErrorMessages() {
document.getElementById('installmentError').textContent = '';
document.getElementById('rateError').textContent = '';
document.getElementById('monthsError').textContent = '';
}

function clearInputs() {
document.getElementById("monthly-installment").value = '';
document.getElementById("rate1").value = '';
document.getElementById("months1").value = '';
document.getElementById("interestEarned1").innerText = '';
document.getElementById("maturityAmount1").innerText = '';
clearErrorMessages();
}
});
document.getElementById("monthly-installment").addEventListener('input', disable);
document.getElementById("rate1").addEventListener('input', disable);
document.getElementById("months").addEventListener('input', disable);
7 changes: 4 additions & 3 deletions tools/sip.html
Original file line number Diff line number Diff line change
Expand Up @@ -2380,11 +2380,11 @@ <h5>Result:</h5>
</div>
<div class="form-group">
<label for="months">Time Period (in months):</label>
<input type="number" id="months1" placeholder="Enter Time Period" required>
<input type="number" id="months" placeholder="Enter Time Period" required>
</div>
<div class="btn-calculate">
<button id="calculate-Btn3" type="button" class="btn btn-calculate">Calculate</button>
<button id="clearBtn2" type="button" class="btn btn-clear">
<button id="calculate-rd" type="button" class="btn btn-calculate" disabled>Calculate</button>
<button id="clear" type="button" class="btn btn-clear">
<p class="btn-text">Clear</p>
</button>
</div>
Expand Down Expand Up @@ -3132,6 +3132,7 @@ <h4 class="title custom-margin">Contact Us</h4>

</script>
<script src="./smoothScroll.js"></script>
<script src="../assets/js/year.js"></script>
</body>

</html>
2 changes: 1 addition & 1 deletion trends.html
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ <h4 class="title custom-margin">Contact Us</h4>
<div class="gtranslate_wrapper"></div>
<script>window.gtranslateSettings = { "default_language": "en", "detect_browser_language": true, "wrapper_selector": ".gtranslate_wrapper" }</script>
<script src="https://cdn.gtranslate.net/widgets/latest/float.js" defer></script>

<script src="./assets/js/year.js"></script>
</body>

</html>