How to use the birthday function from chance
Find comprehensive JavaScript chance.birthday code examples handpicked from public code repositorys.
29 30 31 32 33 34 35 36 37 38
for (let i = 0; i < numPatients; i++) { const gender = Chance.gender(); const omrsId = Chance.string({ pool: REFAPP_OPENMRS_ID_CHARS, }); const bday = Chance.birthday(); // basic demographics const person = { names: [{
8
16
5
+ 9 other calls in file
30 31 32 33 34 35 36 37 38 39
firstName: chance.first(), lastName: chance.last(), isAdmin: false, email: emails.pop(), gender: chance.gender(), dob: chance.birthday({ string: true }), occupation: chance.pickone(['Sales', 'Hospitality', 'Healthcare', 'Custodial', 'Accounting', 'Teaching', 'Law-Enforcement', 'Law', 'Finance', 'Engineering', 'Administration', 'Student', 'Other']), incomeLevel: chance.weighted(['Under-$15,000', '$15,000-to-$24,999', '$25,000-to-$34,999', '$35,000-to-$49,999', '$50,000-to-$74,999', '$75,000-to-$99,999', '$100,000-to-$149,999', '$150,000-to-$199,999', '$200,000-and-over'], [11.6, 10.5, 10, 12.7, 16.7, 12.1, 14.1, 6.2, 6.1]), ethnicity: chance.weighted(['White', 'Black', 'Hispanic', 'Asian', 'American-Indian/Alaska-Native', 'Hawaiian/Other-Pacific-Islander', 'Other'], [61, 12, 18, 6, 1, 0, 2]), religion: chance.weighted(['Protestant', 'Catholic', 'Mormon', 'Judaism', 'Islam', 'Buddhism', 'Hinduism', 'Other', 'Unaffiliated'], [46.5, 20.8, 1.6, 1.9, 0.9, 0.7, 0.7, 3.5, 23.4]),
3
12
6
+ 3 other calls in file
GitHub: ATouhou/FB-Create
15 16 17 18 19 20 21 22 23 24 25
// Generate fake information let firstname = faker.name.firstName(); let surname = faker.name.lastName(); let gender = 1; // 1: Female, 2: Male let year = chance.year({ min: 1996, max: 1998 }); let dob = chance.birthday({ year: year }); nightmare .useragent(ua) .goto('http://m.facebook.com/reg')
4
5
0
52 53 54 55 56 57 58 59 60 61
break; case 'birthday': n = hdr[k].arg; switch (n) { case '2': s += chance.birthday({ string: true, american: false }).toCsv(CSV.delimiter); break;
2
8
0
18 19 20 21 22 23 24 25 26 27
type: spec.label, prefix: chance.prefix({gender: gender }), first: chance.first({gender: gender}), last: chance.last(), age: chance.age(), birthday: chance.birthday({string: true, american: true}), gender: gender, zip: chance.zip({plusfour: true}), ssnFour: chance.ssn({ ssnFour: true }), phone: chance.phone(),
0
1
0
36 37 38 39 40 41 42 43 44
return { kind: enumValues[getRandomInt(0, enumValues.length)], severity: getRandomInt(1, 11), amount: getRandomInt(1000, 10000000), bank: chance.pick(['ICICI', 'AXIS', 'SBI', 'HDFC', 'CITI']), openDate: chance.birthday(), defaults: getRandomInt(0, 10) }; };
0
0
2
137 138 139 140 141 142 143 144 145
postalCode: chance.zip(), country: chance.country(), gender: chance.gender(), orgTitle: chance.sentence({ words: 2 }), orgName: chance.domain(), birthday: chance.birthday({ string: true }), notes: 'Auto-generated contact' }; }
0
0
0
+ 3 other calls in file
chance.word is the most popular function in chance (344 examples)