Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var rates = client.getTable('exchangeRates');
- rates.where(function (cur, low, high) {
- return this.currency == cur && this.time >= low && this.time <= high;
- }, cur, low, high).orderBy("time").read().done(function (results) {
- //no currency rate found on given date range
- if (results.length == 0) {
- //something went wrong
- }
- else {
- //results[0].date is the given date
- callback(results);
- }
- }, function (err) {
- app.showNotification("Error: " + err);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement