Skip to content
Browse files

Fix dates

  • Loading branch information...
1 parent 878883e commit b16681f3d8ba759a4eb79192f18f5521f84e7855 @coruscate coruscate committed Jan 17, 2013
Showing with 5 additions and 4 deletions.
  1. +5 −4 index.js
View
9 index.js
@@ -249,17 +249,18 @@ exports.app = function(opts) {
*/
data: function(options, cb) {
- if (typeof options === 'function') {
+ if (typeof options === 'function') {
cb = options;
options = {}
}
- var start, end;
+ var start = options.start,
+ end = options.end;
if (options.start && options.start instanceof Date) start = options.start.getTime();
- if (start) options.from = opts.start;
+ if (start) options.from = start;
if (options.end && options.end instanceof Date) end = options.end.getTime();
- if (end) options.to = opts.end;
+ if (end) options.to = end;
var opts = {
url: uri + 'device/'+device+'/data',

0 comments on commit b16681f

Please sign in to comment.
Something went wrong with that request. Please try again.