DateTime():isSameOrAfter()
현재 DateTime 객체가 다른 DateTime 객체와 같거나 이후인지 확인합니다.
시그니처
isSameOrAfter(other: DateTime): boolean
매개변수
| 매개변수 | 유형 | 설명 |
|---|---|---|
other | DateTime | 비교할 다른 DateTime 객체. |
반환값
- 유형:
boolean - 현재
DateTime이otherDateTime과 같거나 이후이면true, 그렇지 않으면false.
예시
local date1 = DateTime(2024, 1, 10)
local date2 = DateTime(2024, 1, 5)
local date3 = DateTime(2024, 1, 10)
local result1 = date1:isSameOrAfter(date2) -- 결과는 true
toast(tostring(result1))
local result2 = date1:isSameOrAfter(date3) -- 결과는 true
toast(tostring(result2))
local result3 = date2:isSameOrAfter(date1) -- 결과는 false
toast(tostring(result3))