isBeforeNow
Checks whether a Luxon DateTime is earlier than the current moment. Use it for expiration checks, overdue states, and disabling actions after a deadline.
Importing
ts
import { isBeforeNow } from '@almighty-shogun/utils'Usage
ts
import { DateTime } from 'luxon'
import { isBeforeNow } from '@almighty-shogun/utils'
const expired = isBeforeNow(DateTime.now().minus({ minutes: 1 }));
// trueParameters
| Name | Type | Description |
|---|---|---|
date | DateTime | Date to compare. |
Returns
true when date is earlier than now.
Type signature
ts
declare function isBeforeNow(date: DateTime): boolean;