-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (27 loc) · 1.03 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var dateFormat = require('dateformat');
var datetime = require('node-datetime');
var dt = datetime.create();
var presentDate = dt.format('m/d/Y');//present date
var moment = require('moment');
var gitlab = require('gitlab')({
url: 'https://gbsgit.in.dst.ibm.com',
token: 'aQJ7FotabxTdcrB6WUMU'
});
//console.log(gitlab.projects.allAdmin)
gitlab.projects.allAdmin(function(projects) {
//var c = 0;
//console.log(projects)
for(var proj = 0; proj < projects.length; proj++)
{
var date1 = dateFormat(projects[proj].created_at, "fullDate");
var date2 = dateFormat(projects[proj].last_activity_at, "fullDate");
var date = dateFormat(projects[proj].last_activity_at, "fullDate");
var future = moment(presentDate);
var start = moment(date);
console.log("Project Name: " + projects[proj].name + " Created at: " + date1 + " Last Activity: " + date2 + " days "+ future.diff(start, 'days'))
// c++;
}
//console.log(c)
});
//Proj Names + days diff > 60
[0],[1]