Delicious      Technorati      Blinklist      Furl      Reddit

TimeTrex Time and Attendance

TimeTrex Time and Attendance


* FAQ    * Search
* Login   * Register

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: JSON API filter by date
PostPosted: Wed Jul 05, 2017 8:01 am 
Offline

Joined: Wed Jul 05, 2017 7:53 am
Posts: 3
I am attempting to list a series of punches for a given user on a given day using the JSON API, and the "APIPunch" class, "getPunch" method. I am able to filter the results successfully using filter_data;{user_id:'XXXX'}, but all attempts at filtering the results by either "date_stamp" or "punch_date" return all punches, for all days. I have attempted many varieties of date formatting, including a straight Unix timestamp, with no luck. Is there a way to filter punch data by punch date?


Top
 Profile  
 
PostPosted: Wed Jul 05, 2017 9:04 am 
Offline

Joined: Tue Sep 19, 2006 2:22 pm
Posts: 7299
Try adding this to your filter data:
Code:
'start_date': $start_epoch_value, 'end_date': $end_epoch_value


Top
 Profile  
 
PostPosted: Wed Jul 05, 2017 9:16 am 
Offline

Joined: Wed Jul 05, 2017 7:53 am
Posts: 3
I have added start_date and end_date, and still receive all records. My JSON filter looks like this:

[{"filter_data":{"user_id":"676","start_date":1499212800,"end_date":1499212800}]

When I include the dates, it returns every punch, for every person. If I remove the dates my JSON filter looks like:

[{"filter_data":{"user_id":"676"}]

And this returns only punches for user 676.


Top
 Profile  
 
PostPosted: Wed Jul 05, 2017 9:26 am 
Offline

Joined: Tue Sep 19, 2006 2:22 pm
Posts: 7299
You will need to provide us with more complete code/request samples then, because adding additional parameters shouldn't cause others to be ignored unless there is a bigger problem going on somewhere.


Top
 Profile  
 
PostPosted: Wed Jul 05, 2017 9:44 am 
Offline

Joined: Wed Jul 05, 2017 7:53 am
Posts: 3
Thank you. I found the issue. I was missing a } at the end of the filter_data json.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Time and Attendance




Powered by phpBB® Forum Software © phpBB Group