mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Merge pull request #26591 from AdamVig/chance-add-missing-dateoptions-params
Chance: Add missing properties to DateOptions
This commit is contained in:
@@ -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});
|
||||
|
||||
Vendored
+3
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user