Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

sleep logs by date range simple query data.sleep

ANSWERED

Hi,

i m using the oauth example,

By using GET method for a single night i can easily query my data as so :

 

console.log(data.sleep);

how shall i do the same query when using the range of dates url : 

for now it gives me a "null" answer... I guess i must address by date somewhere...

here is a picture of what i mean, thank you for your help! 

dateRange.jpg

 

merci beaucoup

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions
  var month = ("0" + (avant.getMonth() + 1)).slice(-2);
  var day = ("0" + avant.getDate()).slice(-2);

needs 0 before units...

the oath example is a traitor as it provides a today variable working fine with the single day url but not with the range date...

let todayDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;

 

View best answer in original post

Best Answer
0 Votes
1 REPLY 1
  var month = ("0" + (avant.getMonth() + 1)).slice(-2);
  var day = ("0" + avant.getDate()).slice(-2);

needs 0 before units...

the oath example is a traitor as it provides a today variable working fine with the single day url but not with the range date...

let todayDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;

 

Best Answer
0 Votes