Skip to navigation
Couchdb view what emit the days between 2 dates
07.02.18
function(doc) { if((doc.type =='quotations' || doc.type =='request') && doc.status == 'closed') { var one_day = 24*60*60*1000; var status = doc.status_logs[doc.status_logs.length-1][1]; var last = new Date(doc.status_logs[doc.status_logs.length-1][3]*1000); var start = new Date(Date.parse(doc.request_date)); var diff = Math.round(Math.abs((start.getTime() - last.getTime())/(one_day))); emit([start.getFullYear(),start.getMonth()+1,status],diff) } }
https://www.w3schools.com/jsref/jsref_obj_date.asp
Reply
Anonymous
Information Epoch 1740357026
Avoid captive user interfaces.
Home
Notebook
Contact us