Methods
relativeTimeToDate(text, nowopt) → {RelativeTimeToDateResult}
Converts human readable relative date string, for example, 'in 10 days' to a date relative to now.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
string
|
The text to convert. |
||
now |
Date
|
<optional> |
new Date() |
The date from which add or subtract. Default is now. |
Returns:
- Type:
-
RelativeTimeToDateResult
Type Definitions
RelativeTimeToDateResult
Properties:
Name | Type | Description |
---|---|---|
status |
string
|
The conversion status, |
info |
string
|
The error message if conversion failed, or the relative
time indication ( |
result |
Date
|
undefined
|
The converted date, or |