إنتقل إلى المحتوى الرئيسي

DateTime():isSameOrAfter()

يتحقق ما إذا كان كائن DateTime الحالي مطابقًا لكائن DateTime آخر أو يأتي بعده.

التوقيع

isSameOrAfter(other: DateTime): boolean

المعاملات

المعاملالنوعالوصف
otherDateTimeكائن DateTime الآخر للمقارنة به.

القيمة المعادة

  • النوع: boolean
  • true إذا كان DateTime الحالي مطابقًا لـ other أو يأتي بعده، و false بخلاف ذلك.

أمثلة

local date1 = DateTime(2024, 1, 10)
local date2 = DateTime(2024, 1, 5)
local date3 = DateTime(2024, 1, 10)

local result1 = date1:isSameOrAfter(date2) -- result will be true
toast(tostring(result1))

local result2 = date1:isSameOrAfter(date3) -- result will be true
toast(tostring(result2))

local result3 = date2:isSameOrAfter(date1) -- result will be false
toast(tostring(result3))