generateFutureDate function exported ✓ 100.0%
Last updated: 2026-03-01T23:25:47.120Z
Location
Metrics
LOC: 9
Complexity: 1
Params: 3
Coverage: 100.0% (4/4 lines, 4x executed)
Signature
generateFutureDate(
maxDaysAhead = 365,
format: DateFormat = "iso",
): : string
Summary
Generates a random future date.
Tags
#@param maxDaysAhead - Maximum number of days into the future (default: `365`)#@param format - Output format (default: `"iso"`)
Source Code
export function generateFutureDate(
maxDaysAhead = 365,
format: DateFormat = "iso",
): string {
const now = new Date();
const refDate = new Date(now.getTime() + maxDaysAhead * 86_400_000);
const date = faker.date.between({ from: now, to: refDate });
return formatDate(date, format);
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| formatDate | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| GeneratorFn | calls |