Date
To quickly generate a date in the past, use recent() (last day) or past() (last year). To quickly generate a date in the future, use soon() (next day) or future() (next year). For a realistic birthdate for an adult, use birthdate().
month()
and weekday()
.anytime
Name | Type | Default | Description |
---|---|---|---|
refDate | string | number | Date | {{$date.now}} | The date to use as reference point for the newly generated date. |
between
Name | Type | Default | Description |
---|---|---|---|
from | string | number | Date | The early date boundary. | |
to | string | number | Date | The late date boundary. |
betweens
Name | Type | Default | Description |
---|---|---|---|
count | number | { min: number; max: number; } | 3 | The number of dates to generate. |
from | string | number | Date | The early date boundary. | |
to | string | number | Date | The late date boundary. |
birthdate
'age'
range or the 'year'
range to generate a more specific birthdate.Name | Type | Default | Description |
---|---|---|---|
refDate | string | number | Date | {{$date.now}} | The date to use as reference point for the newly generated date. |
max | number | The maximum age/year to generate a birthdate for/in. | |
min | number | The minimum age/year to generate a birthdate for/in. | |
mode | 'age' | 'year' | Either 'age' or 'year' to generate a birthdate based on the age or year range. | |
refDate | string | number| Date | {{$date.now}} | The date to use as reference point for the newly generated date. Only used when mode is 'age' . |
future
Name | Type | Default | Description |
---|---|---|---|
refDate | string | number | Date | {{$date.now}} | The date to use as reference point for the newly generated date. |
years | number | 1 | The range of years the date may be in the future. |
month
Name | Type | Default | Description |
---|---|---|---|
abbreviated | boolean | false | Whether to return an abbreviation. |
context | boolean | false | Whether to return the name of a month in the context of a date. In the default en locale this has no effect, however, in other locales like fr or ru , this may affect grammar or capitalization, for example 'январь' with { context: false } and 'января' with { context: true } in ru . |
past
Name | Type | Default | Description |
---|---|---|---|
refDate | string | number | Date | {{$date.now}} | The date to use as reference point for the newly generated date. |
years | number | 1 | The range of years the date may be in the past. |
recent
Name | Type | Default | Description |
---|---|---|---|
days | number | 1 | The range of days the date may be in the past. |
refDate | string | number | Date | {{$date.now}} | The date to use as reference point for the newly generated date. |
soon
Name | Type | Default | Description |
---|---|---|---|
days | number | 1 | The range of days the date may be in the future. |
refDate | string | number | Date | {{$date.now}} | The date to use as reference point for the newly generated date. |
timeZone
weekday
Name | Type | Default | Description |
---|---|---|---|
abbreviated | boolean | false | Whether to return an abbreviation. |
context | boolean | false | Whether to return the day of the week in the context of a date. In the default en locale this has no effect, however, in other locales like fr or ru , this may affect grammar or capitalization, for example 'Lundi' with { context: false } and 'lundi' with { context: true } in fr . |