Skip to content

Commit d8c83fc

Browse files
authored
Clarify documentation of DateAndTime.birthday(..)
When using DateAndTime.birthday(..) it's not obvious that the generated birthday depends on the current day. This leads to the wrong assumption that calling the method with the same random seed creates the same birthday with every call. However, the method produces different results whether it's called in 2020 or 2021. This commit adds clarification to the method's Javadoc.
1 parent b60f23a commit d8c83fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/com/github/javafaker/DateAndTime.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,22 @@ public Date between(Date from, Date to) throws IllegalArgumentException {
153153
}
154154

155155
/**
156-
* Generates a random birthday between 65 and 18 years ago.
156+
* Generates a random birthday between 65 and 18 years ago from now.
157157
*
158-
* @return a random birthday between 65 and 18 years ago.
158+
* @return a random birthday between 65 and 18 years ago from now.
159159
*/
160160
public Date birthday() {
161161
return birthday(DEFAULT_MIN_AGE, DEFAULT_MAX_AGE);
162162
}
163163

164164
/**
165-
* Generates a random birthday between two ages.
165+
* Generates a random birthday between two ages from now.
166166
*
167167
* @param minAge
168168
* the minimal age
169169
* @param maxAge
170170
* the maximal age
171-
* @return a random birthday between {@code minAge} and {@code maxAge} years ago.
171+
* @return a random birthday between {@code minAge} and {@code maxAge} years ago from now.
172172
* @throws IllegalArgumentException
173173
* if the {@code maxAge} is lower than {@code minAge}.
174174
*/

0 commit comments

Comments
 (0)