mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Decided not to include zero fields, for consistency.
This commit is contained in:
parent
54d065f4a1
commit
795ef164fb
@ -111,6 +111,10 @@ var parseInterval = function(val) {
|
||||
if (i.minutes) i.minutes *= -1;
|
||||
if (i.seconds) i.seconds *= -1;
|
||||
}
|
||||
for (field in i){
|
||||
if (i[field] == 0)
|
||||
delete i[field];
|
||||
}
|
||||
return i;
|
||||
};
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ test('typed results', function() {
|
||||
dataTypeID: 1186,
|
||||
actual: '1 day -00:00:03',
|
||||
expected: function(val) {
|
||||
assert.deepEqual(val, {'days':1, 'hours': 0, 'minutes': 0, 'seconds':-3})
|
||||
assert.deepEqual(val, {'days':1, 'seconds':-3})
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user