Adds Relative Time options now,weeks & years (#4304)
* Adds 'now' as an option in relative time * reenables no-console in previous spot * Adds weeks,months,years and abbreviations * modified tests to address coverage * month be gone!
This commit is contained in:
committed by
GitHub
parent
84aadba23a
commit
46af1b6955
@@ -3152,6 +3152,31 @@ describe('Parse.Query testing', () => {
|
||||
.then((results) => {
|
||||
expect(results.length).toBe(2);
|
||||
})
|
||||
.then(() => {
|
||||
const q = new Parse.Query('MyCustomObject');
|
||||
q.greaterThan('ttl', { $relativeTime: 'now' });
|
||||
return q.find({ useMasterKey: true });
|
||||
})
|
||||
.then((results) => {
|
||||
expect(results.length).toBe(1);
|
||||
})
|
||||
.then(() => {
|
||||
const q = new Parse.Query('MyCustomObject');
|
||||
q.greaterThan('ttl', { $relativeTime: 'now' });
|
||||
q.lessThan('ttl', { $relativeTime: 'in 1 day' });
|
||||
return q.find({ useMasterKey: true });
|
||||
})
|
||||
.then((results) => {
|
||||
expect(results.length).toBe(0);
|
||||
})
|
||||
.then(() => {
|
||||
const q = new Parse.Query('MyCustomObject');
|
||||
q.greaterThan('ttl', { $relativeTime: '1 year 3 weeks ago' });
|
||||
return q.find({ useMasterKey: true });
|
||||
})
|
||||
.then((results) => {
|
||||
expect(results.length).toBe(2);
|
||||
})
|
||||
.then(done, done.fail);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user