SparkFun Forums 

Where electronics enthusiasts find answers.

Everything pertaining to the data.sparkfun.com service, the phant project which powers it, and user projects which talk to the service.
By eephillip
#180462
How does one format the ajax JSONP object to do a filter on the timestamp.
Maybe the answer is you can't only support for URL encoding?

The following is from here
https://github.com/sparkfun/phant/issues/98
Date range query string example (in UTC):
Code: Select all
?gt[timestamp]=2014-08-15&lt[timestamp]=2014-08-20
Code: Select all
?gt[timestamp]=now -2 months&lt[timestamp]=now -1 month
day(s), week(s), month(s) and year(s) are supported

Trying to do somthing like the following.
Code: Select all
var jsonData = $.ajax({
        url: 'https://data.sparkfun.com/output/' + public_key + '.json',
        // data: {page: 5},
        // gt : now -2 hours',
        // 'gt[timestamp]' : 'now -1 hour',
        'lte' : ['timestamp', 'now - 2 hour'],     
        dataType: 'jsonp',
})
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]