Topic: API - fix jobs over a month old not appearing
That's right - I got really confused when, despite having count=10 and days_behind=0 in my code, it was still only showing the latest 2 jobs (which were added together) and not the full 10 it should have been.
Well, a bit of investigation and it turns out that days_behind doesn't really work that well.
Reason being, in the SQL contained in class.Job.php for the ApiGetJobs function, there is this code:
created_on > DATE_SUB(NOW(), INTERVAL 31 DAY)Now, I don't know my SQL very well but I couldn't understand why that 31 day mention was there, so I tried changing it to
created_on > DATE_SUB(NOW(), INTERVAL 365 DAY)and now it works fine - so quite why it's there, I don't know, but it's an override that puts a maximum limit on your days_behind value.
Feel free to change it like I have so that the maximum reach-back is a year's worth; obviously I can't see any reason why you couldn't put a monstrous number there to make it effectively truly all jobs.