6sYxT4cNJ9IjpWiW9qgCut changeset

Changeset343630623963 (b)
Parent653536373336 (a)
ab
0+MAP
0+===
0+Date.prototype.setRFC3339 = function(dString){
0+    var regexp = /(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/;
0+
0+    if (dString.toString().match(new RegExp(regexp))) {
0+        var d = dString.match(new RegExp(regexp));
0+        var offset = 0;
0+
0+        this.setUTCDate(1);
0+        this.setUTCFullYear(parseInt(d[1],10));
0+        this.setUTCMonth(parseInt(d[3],10) - 1);
0+        this.setUTCDate(parseInt(d[5],10));
0+        this.setUTCHours(parseInt(d[7],10));
0+        this.setUTCMinutes(parseInt(d[9],10));
0+        this.setUTCSeconds(parseInt(d[11],10));
0+        if (d[12])
0+            this.setUTCMilliseconds(parseFloat(d[12]) * 1000);
0+        else
0+            this.setUTCMilliseconds(0);
0+        if (d[13] != 'Z') {
0+            offset = (d[15] * 60) + parseInt(d[17],10);
0+            offset *= ((d[14] == '-') ? -1 : 1);
0+            this.setTime(this.getTime() - offset * 60 * 1000);
0+        }
0+    } else {
0+        this.setTime(Date.parse(dString));
0+    }
0+    return this;
0+};
0+ 
0+function(doc) {
0+ 
0+    if (doc.doc_type=="EdoPing" && doc.em_type==0) {
0+        date = new Date().setRFC3339(doc.created_at);
0+        var key = doc.em_uname + String(doc.created_at).substring(0,10);
0+         
0+           
0+        emit([doc.created_at.substring(0,10) ] ,  [doc.em_uname, 1] );
0+         
0+    }
0+}
0+
0+REDUCE
0+======
...
00function(keys, values, rereduce) {
11
22   
...
3333    }
3434    return [ucount, seen];
3535   }
...
36+   
36+==========
36+
36+ 
36+
...
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- Revision 653536373336
+++ Revision 343630623963
@@ -1,3 +1,48 @@
+MAP
+===
+Date.prototype.setRFC3339 = function(dString){
+ var regexp = /(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/;
+
+ if (dString.toString().match(new RegExp(regexp))) {
+ var d = dString.match(new RegExp(regexp));
+ var offset = 0;
+
+ this.setUTCDate(1);
+ this.setUTCFullYear(parseInt(d[1],10));
+ this.setUTCMonth(parseInt(d[3],10) - 1);
+ this.setUTCDate(parseInt(d[5],10));
+ this.setUTCHours(parseInt(d[7],10));
+ this.setUTCMinutes(parseInt(d[9],10));
+ this.setUTCSeconds(parseInt(d[11],10));
+ if (d[12])
+ this.setUTCMilliseconds(parseFloat(d[12]) * 1000);
+ else
+ this.setUTCMilliseconds(0);
+ if (d[13] != 'Z') {
+ offset = (d[15] * 60) + parseInt(d[17],10);
+ offset *= ((d[14] == '-') ? -1 : 1);
+ this.setTime(this.getTime() - offset * 60 * 1000);
+ }
+ } else {
+ this.setTime(Date.parse(dString));
+ }
+ return this;
+};
+
+function(doc) {
+
+ if (doc.doc_type=="EdoPing" && doc.em_type==0) {
+ date = new Date().setRFC3339(doc.created_at);
+ var key = doc.em_uname + String(doc.created_at).substring(0,10);
+
+
+ emit([doc.created_at.substring(0,10) ] , [doc.em_uname, 1] );
+
+ }
+}
+
+REDUCE
+======
function(keys, values, rereduce) {
@@ -34,3 +79,8 @@
}
return [ucount, seen];
}
+
+==========
+
+
+