No title Revision 336638613431 (Sat Mar 06 2010 at 15:25) - Diff Link to this snippet: https://friendpaste.com/5xUUQ26bbl9d5KRB8eojwe Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950Date.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;};var seenKeys = new Array();function(doc) {/** em_type of 0 is a student ping*/ 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); if (seenKeys[key] == undefined ) { seenKeys[key] = 1; emit([date.getFullYear(), parseInt(date.getMonth())+1, date.getDate() ] , 1); } }}/* ------------------------ */_count()