Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  var rates = client.getTable('exchangeRates');
  3.         rates.where(function (cur, low, high) {
  4.             return this.currency == cur && this.time >= low && this.time <= high;
  5.         }, cur, low, high).orderBy("time").read().done(function (results) {
  6.             //no currency rate found on given date range
  7.             if (results.length == 0) {
  8.                 //something went wrong
  9.             }
  10.             else {
  11.                 //results[0].date is the given date
  12.                 callback(results);
  13.             }
  14.         }, function (err) {
  15.             app.showNotification("Error: " + err);
  16.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement