Merge branch 'master' of bitbucket.org:venbainformationtechnology/smc_cet_mainapp_backend
This commit is contained in:
commit
3bc5c8d746
@ -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" });
|
||||
|
||||
@ -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
4774
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user