Skip to content

Commit

Permalink
Fix date domain and incorrect test case (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
RileyChang authored and kanitw committed Aug 31, 2016
1 parent 7fe9840 commit d10607d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class Schema {
return [+fieldSchema.stats.min, +fieldSchema.stats.max];
} else if (fieldSchema.primitiveType === PrimitiveType.DATE) {
// return [min, max] dates
domain = [fieldSchema.stats.min, fieldSchema.stats.max];
return [fieldSchema.stats.min, fieldSchema.stats.max];
} else if (fieldSchema.primitiveType === PrimitiveType.INTEGER ||
fieldSchema.primitiveType === PrimitiveType.NUMBER) {
// coerce non-quantitative numerical data into number type
Expand Down
4 changes: 2 additions & 2 deletions test/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ describe('schema', () => {
it('should return a date array containing correctly translated date types', () => {
var domain: Date[] = domainSchema.domain({field: 'e', channel: Channel.X});
assert.equal(domain.length, 2);
assert.equal(domain[0].getTime(), new Date('7/14/2016').getTime());
assert.equal(domain[1].getTime(), new Date('6/14/2016').getTime());
assert.equal(domain[0].getTime(), new Date('6/14/2016').getTime());
assert.equal(domain[1].getTime(), new Date('7/14/2016').getTime());
});
});

Expand Down

0 comments on commit d10607d

Please sign in to comment.