fix and test for Sugarjs backwards date range problem