Luxon: TypeError: DateTime.isAfter is not a function

Created on 1 Oct 2018  路  2Comments  路  Source: moment/luxon

After reading the docs for the isAfter method: https://moment.github.io/luxon/docs/class/src/interval.js~Interval.html#instance-method-isAfter

I'm not sure if I'm using it correctly:

Luxon version: 1.3.3

const a = DateTime.local();
// wait a couple seconds
const b = DateTime.local();
b.isAfter(a); // should return true but returns:
TypeError: b.isAfter is not a function

What is the right way to use the isAfter method?

Most helpful comment

All 2 comments

After reading the docs a bit more, it looks like the isAfter method works only on Interval objects and not DateTime objects.

Does anyone know how to use isAfter like MomentObject.isAfter(MomentObject2)?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshhepworth picture joshhepworth  路  5Comments

zbraniecki picture zbraniecki  路  6Comments

kwtucker picture kwtucker  路  6Comments

thetuyen picture thetuyen  路  4Comments

jasonwilliams picture jasonwilliams  路  6Comments