Merge branch 'master' of bitbucket.org:venbainformationtechnology/smc_cet_mainapp_backend

This commit is contained in:
suseendhiran17 2022-03-19 17:50:16 +05:30
commit 3bc5c8d746
4 changed files with 43 additions and 4760 deletions

View File

@ -543,7 +543,30 @@ exports.test = async (req, res) =>
{
try
{
start_date = "'2019-08-12'";
let starting_date = new Date(start_date);
end_date = "'2021-05-12'";
let date = new Date(end_date);
years_skeleton = [];
for(let i=0;i<12;i++)
{
//store on fly month number
month_count = date.getMonth() + 1;
//create on fly month data
new_date = date.toLocaleString('default', { month: 'short' })+"-"+date.getFullYear();
//create on fly period data
new_period = date.getFullYear()+"-"+month_count+"-01";
obj = {month:new_date,period:new_period};
// push skeleton object
years_skeleton.push(obj);
//Reset date here
date.setMonth(date.getMonth() - 1);
//check if loop meets starting date or not
if(starting_date.getFullYear() == date.getFullYear() && starting_date.getMonth() + 1 == month_count) { break; }
}
console.log(years_skeleton);
} catch(err) {
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });

View File

@ -28,7 +28,7 @@ router.get("/test", Entitycontroller.test);
* /api/landingPageApi:
* get:
* summary: Loan Numbers Details List
* description: Get loan Number Details List by sending Los id (Primary key)
* description: Get loan Number Details List
* responses:
* 200:
* description: success

4774
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ const options = {
definition: {
openapi: '3.0.0',
info: {
title: 'Smc_cet_financials',
title: 'Smc_Cet MainApp',
version: '1.0.0',
},
},