Merge pull request #26591 from AdamVig/chance-add-missing-dateoptions-params

Chance: Add missing properties to DateOptions
This commit is contained in:
Nathan Shively-Sanders
2018-06-20 14:08:00 -07:00
committed by GitHub
2 changed files with 18 additions and 1 deletions
+15
View File
@@ -71,3 +71,18 @@ euro = chance.euro({opt: 'abc'});
let coin = chance.coin();
coin = chance.coin();
// Make sure date works with min and max parameters
let date: string|Date = chance.date();
let min = new Date();
let max = new Date();
date = chance.date({min, max});
min = new Date();
min.setFullYear(new Date().getFullYear() - 15);
max = new Date();
max.setFullYear(new Date().getFullYear() + 15);
date = chance.date({min, max});
date = chance.date({min});
date = chance.date({max});
+3 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Chance 1.0.13
// Type definitions for Chance 1.0.16
// Project: http://chancejs.com
// Definitions by: Chris Bowdon <https://github.com/cbowdon>
// Brice BERNARD <https://github.com/brikou>
@@ -189,6 +189,8 @@ declare namespace Chance {
year?: number;
month?: number;
day?: number;
min?: Date;
max?: Date;
}
interface Month {