diff --git a/src/schema.ts b/src/schema.ts index 44002e6c..1cd837dd 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -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 diff --git a/test/schema.test.ts b/test/schema.test.ts index f76f7354..d8153280 100644 --- a/test/schema.test.ts +++ b/test/schema.test.ts @@ -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()); }); });