Centralised the date selector for graphs for re-use

This commit is contained in:
laf
2015-10-20 21:35:08 +00:00
parent 9c5decb47d
commit e9deae1315
7 changed files with 94 additions and 66 deletions

View File

@ -97,3 +97,15 @@ $(document).ready(function() {
});
});
});
function submitCustomRange(frmdata) {
var reto = /to=([0-9])+/g;
var refrom = /from=([0-9])+/g;
var tsto = moment(frmdata.dtpickerto.value).unix();
var tsfrom = moment(frmdata.dtpickerfrom.value).unix();
frmdata.selfaction.value = frmdata.selfaction.value.replace(reto, 'to=' + tsto);
frmdata.selfaction.value = frmdata.selfaction.value.replace(refrom, 'from=' + tsfrom);
frmdata.action = frmdata.selfaction.value;
return true;
}