Skip to content

Commit 1011b04

Browse files
committed
date in array
1 parent c883a0f commit 1011b04

File tree

7 files changed

+47
-16
lines changed

7 files changed

+47
-16
lines changed

public/images/ajax_tips.png

-3 Bytes
Loading

public/images/close.png

-340 Bytes
Loading

public/images/ico_warn.png

-3.5 KB
Loading

public/images/plus_icon.png

-71 Bytes
Loading

public/js/index.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,44 @@ define(function(require){
2121
chart: {
2222
},
2323
title: {
24-
text: '一月提问走势'
24+
text: '月提问走势图',
25+
style : {
26+
color: '#900f49',
27+
fontSize :'28px',
28+
fontFamily :'MicroSoft YaHei'
29+
}
2530
},
2631
xAxis: {
2732
categories: ['Apples', 'Oranges', 'Pears', 'Bananas', 'Plums']
2833
},
34+
yAxis: {
35+
title : {
36+
text : '问题个数',
37+
style : {
38+
color: '#ff775c',
39+
fontFamily :'MicroSoft YaHei',
40+
fontWeight: 'normal',
41+
fontSize: '14px'
42+
}
43+
}
44+
},
2945
tooltip: {
3046
formatter: function() {
3147
var s;
3248
s = ''+this.x +':信息 '+ this.y;
3349
return s;
3450
}
3551
},
36-
labels: {
37-
items: [{
38-
html: '统计你的提问频率',
39-
style: {
40-
left: '40px',
41-
top: '8px',
42-
color: 'black'
43-
}
44-
}]
45-
},
4652
series: [{
4753
type: 'column',
48-
name: 'Jane',
54+
name: '未解决个数',
4955
data: [3, 2, 1, 3, 4]
50-
}, {
56+
},{
5157
type: 'spline',
5258
name: 'Average',
53-
data: [3, 2.67, 3, 6.33, 3.33],
59+
data: [3, 2, 1, 3, 4],
5460
marker: {
55-
lineWidth: 10,
61+
lineWidth: 1,
5662
lineColor: Highcharts.getOptions().colors[3],
5763
fillColor: 'white'
5864
}

routes/login.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,35 @@ var index = function(req,res){
4343
},
4444
get : {
4545
askdate : 1
46+
},
47+
sort : {
48+
askdate : -1
4649
}
4750
},'qa',function(err,doc){
4851
if(err)doc=[];
52+
var list = new Object();
53+
// var df = new Object();
4954
if(doc.length){
50-
console.log(doc)
55+
var start = doc[0].askdate;
56+
var num = 0;
57+
for(var i=0;i<doc.length;i++){
58+
if(doc[i].askdate <= start && doc[i].askdate >(start-36000) ){
59+
++num;
60+
}else{
61+
list[start] = num;
62+
num = 1;
63+
if(i === doc.length-1){
64+
list[doc[i].askdate] = num;
65+
}else{
66+
start = doc[i].askdate;
67+
}
68+
}
69+
}
70+
for(var key in list){
71+
var s= utils.format.call(new Date(parseInt(key,10)),'yyyy-MM-dd hh:mm:ss');
72+
console.log(s)
73+
}
74+
console.log(list)
5175
}
5276
--n || render();
5377
});

views/index/index.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ block content
3838
.grey-tips.red 公告:#{result.notice}
3939
h2 提问走势图
4040
#charts
41+
input(type="hidden",value="")
4142
block link
4243
if result.links && result.links.length
4344
.container.link

0 commit comments

Comments
 (0)