function date_and_time() {
var date = new Date();
//zero-pad a single zero if needed
var zp = function (val){
return (val <= 9 ? ‘0’ + val : ‘’ + val);
}
//zero-pad up to two zeroes if needed
var zp2 = function(val){
return val <= 99? (val <=9? ‘00’ + val : ‘0’ + val) : (’’ + val ) ;
}
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getFullYear();
var h = date.getHours();
var min = date.getMinutes();
var s = date.getSeconds();
var ms = date.getMilliseconds();
return ‘’ + zp(m) + ‘/’ + zp(d) + ‘/’ + y + ’ ’ + zp(h) + ‘:’ + zp(min) + ‘:’ + zp(s);
}
var query = “Status = ‘Accepted’ and EndDate < '” + date_and_time() + “’”;
var caseStorage = Backendless.Persistence.of( Cases );
var dataQuery = new Backendless.DataQuery();
dataQuery.condition = query;
var cases = caseStorage.find( dataQuery , new Backendless.Async(casesFound, gotError));
function date_and_time() {
var date = new Date();
//zero-pad a single zero if needed
var zp = function (val){
return (val <= 9 ? ‘0’ + val : ‘’ + val);
}
//zero-pad up to two zeroes if needed
var zp2 = function(val){
return val <= 99? (val <=9? ‘00’ + val : ‘0’ + val) : (’’ + val ) ;
}
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getFullYear();
var h = date.getHours();
var min = date.getMinutes();
var s = date.getSeconds();
var ms = date.getMilliseconds();
return ‘’ + zp(m) + ‘/’ + zp(d) + ‘/’ + y + ’ ’ + zp(h) + ‘:’ + zp(min) + ‘:’ + zp(s);
}
var query = “Status = ‘Accepted’ and EndDate < '” + date_and_time() + “’”;
var caseStorage = Backendless.Persistence.of( Cases );
var dataQuery = new Backendless.DataQuery();
dataQuery.condition = query;
var cases = caseStorage.find( dataQuery , new Backendless.Async(casesFound, gotError));