Closed btd1337 closed 1 year ago
isTheSame is a function already...
You use dto.isSame(otherDto, "day")
and it does the comparison.
isFuture and isPast are useless because you can do dto > otherDto
or if Typescript complains about comparing not integer values, you can do dto.valueOf() > otherDto.valueOf()
.
Cheers.
@tonysamperi thanks for your answer and the isSame
function explanation.
But...
The isFuture
and isPast
functions It's not in this way as you mentioned:
The feature I would like you to add would be like this:
date1.isFuture("day");
date1.isFuture(date2, "day")
date1.isPast("day");
date1.isPast(date2, "day")
Example:
date1 = "2023-07-25 10:00:00"
date2 = 2023-07-25 10:00:00
date1.isFuture(date2, "day") // false
date3 = 2023-07-24 10:00:00
date1.isFuture(date3, "day") // true
It would be very valuable if you reconsidered!
Thanks in advance
@btd1337 easy peasy
dto.startOf("day") > otherDto
And you can do the same using
dto.diff(otherDto, "days")
or something similar, I don't remember right know.
Believe me.
You can already do what you ask.
Then if you often use this stuff, you can make your own Luxon helper to gather specific functions!
Cheers
Would it be possible to add the following functions to the library?
Thanks in advance!