From 6ffe29fc761c2f6a832a3c5625c20422b85fcc87 Mon Sep 17 00:00:00 2001 From: satyam prajapati Date: Mon, 10 Feb 2025 16:14:21 +0530 Subject: [PATCH 1/2] adding year/automate branch --- Licensing.html | 2 +- about.html | 1 + assets/js/year.js | 4 ++++ blog.html | 2 +- blogs/privacy-policy.html | 2 +- blogs/refund-policy.html | 1 + blogs/terms-of-service.html | 2 +- contact.html | 1 + contributors.html | 2 +- faq.html | 3 +-- finance.html | 1 + index.html | 2 +- maps.html | 1 + quiz.html | 2 +- server/package.json | 3 ++- tools/sip.html | 1 + trends.html | 2 +- 17 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 assets/js/year.js diff --git a/Licensing.html b/Licensing.html index ca46dda8..14300ea6 100644 --- a/Licensing.html +++ b/Licensing.html @@ -1159,6 +1159,6 @@

Contact Us

}); }); - + diff --git a/about.html b/about.html index 23d50000..f2a234ed 100644 --- a/about.html +++ b/about.html @@ -1847,6 +1847,7 @@

Contact Us

+ diff --git a/assets/js/year.js b/assets/js/year.js new file mode 100644 index 00000000..4fbd412b --- /dev/null +++ b/assets/js/year.js @@ -0,0 +1,4 @@ +const copyright_year = document.getElementById('copyright-year'); +const year = new Date().getFullYear(); + +copyright_year.innerText = year; diff --git a/blog.html b/blog.html index e6a2f5ea..64c8551a 100644 --- a/blog.html +++ b/blog.html @@ -1460,7 +1460,7 @@

Contact Us

}); - + diff --git a/blogs/privacy-policy.html b/blogs/privacy-policy.html index bd59fdc1..5adbc4a1 100644 --- a/blogs/privacy-policy.html +++ b/blogs/privacy-policy.html @@ -1049,6 +1049,6 @@

Contact Us

updateWeekly(); }); - + diff --git a/blogs/refund-policy.html b/blogs/refund-policy.html index f46a9bf8..a575f897 100644 --- a/blogs/refund-policy.html +++ b/blogs/refund-policy.html @@ -1063,6 +1063,7 @@

Contact Us

} + \ No newline at end of file diff --git a/blogs/terms-of-service.html b/blogs/terms-of-service.html index ef612d48..4b967d8a 100644 --- a/blogs/terms-of-service.html +++ b/blogs/terms-of-service.html @@ -837,7 +837,7 @@

Contact Us

updateWeekly(); }); - + diff --git a/contact.html b/contact.html index fe994d82..389a0740 100644 --- a/contact.html +++ b/contact.html @@ -1855,6 +1855,7 @@

Contact Us

+ - + diff --git a/faq.html b/faq.html index 07da83f4..aa9d8f3f 100644 --- a/faq.html +++ b/faq.html @@ -1621,8 +1621,7 @@

Contact Us

- - + diff --git a/finance.html b/finance.html index 7b95b50c..e2011dd5 100644 --- a/finance.html +++ b/finance.html @@ -638,6 +638,7 @@

Contact Us

+ - + + diff --git a/quiz.html b/quiz.html index da49749d..3f5f22ce 100644 --- a/quiz.html +++ b/quiz.html @@ -1083,7 +1083,7 @@

Contact Us

- + diff --git a/server/package.json b/server/package.json index 0cfd053c..412637e2 100644 --- a/server/package.json +++ b/server/package.json @@ -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:" } } \ No newline at end of file diff --git a/tools/sip.html b/tools/sip.html index a015aa2e..a7a3f612 100644 --- a/tools/sip.html +++ b/tools/sip.html @@ -3132,6 +3132,7 @@

Contact Us

+ \ No newline at end of file diff --git a/trends.html b/trends.html index 53953d9b..88ebba98 100644 --- a/trends.html +++ b/trends.html @@ -1277,7 +1277,7 @@

Contact Us

- + From 878515c9d9d7274c3a83c34b820c379b2073490e Mon Sep 17 00:00:00 2001 From: satyam prajapati Date: Tue, 11 Feb 2025 10:33:33 +0530 Subject: [PATCH 2/2] fixing bug of rd calculator --- tools/RDCalculator.js | 117 ++++++++++++++++-------------------------- tools/sip.html | 6 +-- 2 files changed, 48 insertions(+), 75 deletions(-) diff --git a/tools/RDCalculator.js b/tools/RDCalculator.js index 6da695df..9d0afcb9 100644 --- a/tools/RDCalculator.js +++ b/tools/RDCalculator.js @@ -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(); - } -}); \ No newline at end of file +document.getElementById("monthly-installment").addEventListener('input', disable); +document.getElementById("rate1").addEventListener('input', disable); +document.getElementById("months").addEventListener('input', disable); \ No newline at end of file diff --git a/tools/sip.html b/tools/sip.html index a7a3f612..257de085 100644 --- a/tools/sip.html +++ b/tools/sip.html @@ -2380,11 +2380,11 @@
Result:
- +
- - +