Predicate function - Date

The date functions are used for validating dates, times, formats, and temporal conditions.

  • Date predicate functions are culture-aware and respect the current tenant or user locale.

  • Functions return false for invalid inputs and do not throw exceptions.

  • Supported inputs include strings, numbers (timestamps), and date objects as applicable.

  • If culture-specific parsing fails, the system falls back to Invariant Culture (English).

  • Several date predicate functions accept culture-sensitive parameters such as month and day names:

    • IsMonthOfYear: Accepts month names in any supported culture (for example: "January", "janvier", "Januar", "enero", "1月").
    • IsDayOfWeek: Accepts day names in any supported culture (for example: "Monday", "lundi", "Montag", "lunes", "月曜日").

  • Unless explicitly specified otherwise, all date comparisons are inclusive and evaluated using the local system date and time.

Function

Description

Example

IsDate(value) Returns true if the value can be parsed as a date.

  • "2024-03-15" is true

  • "not a date" is false

IsDateTime(value) Returns true if the value is a valid date and time.

  • "2024-03-15T10:30:00" is true

  • "2024-03-15" is false

IsTime(value) Returns true if the value is a valid time (either 12-hor or 24-hour format).

  • "10:30 AM" is true

  • "25:00" is false

IsTime12Hour(value) Returns true if the value is a valid 12-hour time format (including AM or PM).

  • "10:30 PM" is true

  • "22:30" is false

IsTime24Hour(value) Returns true if the value is a valid 24-hour time format (without AM or PM).

  • "22:30" is true

  • "10:30 AM" is false

IsTimestamp(value) Returns true if the value is a valid Unix timestamp (seconds or milliseconds).

  • 1710460800 is true

  • "abc" is false

IsISODate(value) Returns true if the value is in ISO 8601 date or datetime format.

  • "2024-03-15" is true

  • "03/15/2024" is false

IsUSDate(value) Returns true if the date is in US format (MM/DD/YYYY).

  • "03/15/2024" is true

  • "15/03/2024" is false

IsUKDate(value) Returns true if the date is in UK format (DD/MM/YYYY).

  • "15/03/2024" is true

  • "03/15/2024" is false

IsEuropeanDate(value) Returns true if the date is in European format (DD.MM.YYYY using a period seperator).

  • "25.12.2026" is true

  • "25/12/2026" is false

IsValidDateFormat(value, format) Returns true if the value matches the specified date format.

  • ("03/15/2024","MM/dd/yyyy") is true

  • ("15/03/2024","MM/dd/yyyy") is false

IsToday(value) Returns true if the value is today's date.

  • Current date string is true

  • Yesterday is false

IsYesterday(value) Returns true if the value is yesterday's date.

  • Yesterday's timestamp is true

  • Today is false

IsTomorrow(value) Returns true if the value is tomorrow's date.

  • Tomorrow's date is true

  • Today is false

IsThisWeek(value) Returns true if the date falls within the current week.

  • Today is true

  • Last week is false

IsThisMonth(value) Returns true if the date falls within the current calendar month.

  • First day of month is true

  • Last month is false

IsThisYear(value) Returns true if the date is in the current calendar year.

  • Current year string is true

  • Last year is false

IsInPast(value) Returns true if the date or time is in the before the current moment.

  • Yesterday is true

  • Tomorrow is false

IsInFuture(value) Returns true if the date or time is in the after the current moment.

  • Tomorrow is true

  • Yesterday is false

IsOnOrAfterToday(value) Returns true if the date is today or a future date.

  • Today is true

  • Yesterday is false

IsOnOrAfterTomorrow(value) Returns true if the date is tomorrow or later.

  • Tomorrow is true

  • Today is false

IsAfter(date, referenceDate) Returns true if the first date is after the reference date.

  • ("2024-03-15","2024-03-14") is true

  • ("2024-03-14","2024-03-15") is false

IsBefore(date, referenceDate) Returns true if the first date is before the reference date.

  • ("2024-03-14","2024-03-15") is true

  • ("2024-03-15","2024-03-14") is false

IsOnOrAfter(date, referenceDate) Returns true if the first date is on or after the reference date.

  • ("2024-03-15", "2024-03-14") is true

  • ("2024-03-14", "2024-03-15") is false

IsOnOrBefore(date, referenceDate) Returns true if the first date is on or before the reference date.

  • ("2024-03-14", "2024-03-15") is true

  • ("2024-03-15", "2024-03-14") is false

IsBetween(date, startDate, endDate) Returns true if the given date is within the specified start and end date range (inclusive).

  • ("2024-03-15","2024-03-01","2024-03-31") is true

  • ("2024-04-01", "2024-03-01", "2024-03-31") is true

IsWithinLastDays(date, days) Returns true if the date is within the specified number days in the past.

  • (yesterday, 7) is true

  • (8 days ago, 7) is true

IsWithinNextDays(date, days) Returns true if the date is within the specified number of days in the future.

  • (tomorrow, 7) is true

  • (8 days from now, 7) is true

IsOlderThanDays(date, days) Returns true if the date is older than the specified number of days.

  • (365 days ago, 30) is true

  • (5 days ago , 7) is true

IsNewerThanDays(date, days) Returns true if the date is newer than the specified number of days.

  • (today ,7) is true

  • (8 days ago, 7)

IsWeekday(value) Returns true if the date is a weekday (Monday-Friday).

  • Monday is true

  • Sunday is false

IsWeekend(value) Returns true if the date is a weekend (Saturday-Sunday).

  • Saturday is true

  • Monday is false

IsBusinessDay(value) Returns true if the date is a business day (weekday and not a holiday).

  • Monday is true

  • Holiday is false

IsHoliday(value) Returns true if the date is a configured holiday.

  • "2024-12-25" is true (if configured)

  • Regular weekday is false

IsDayOfWeek(value, day) Returns true if the date falls on the specified day of week.

  • ("2024-03-18","Monday") is true

  • ("2026-05-04"),"Montag") is true

  • ("2024-03-18", "Tuesday") is false

IsStartOfMonth(value) Returns true if the date is the first day of the month.

  • "2024-03-01" is true

  • "2024-03-02" is false

IsEndOfMonth(value) Returns true if the date is the last day of the month.

  • "2024-03-31" is true

  • "2024-03-01" is false

IsMonthOfYear(value, month) Returns true if the date is in the specified month.

  • ("2024-03-15","March") is true

  • ("2026-01-01","enero") is true

  • ("2024-03-15", "April") is false

IsQuarter(value, quarter) Returns true if the date is in the specified quarter of the year.

  • ("2024-03-15",1) is true

  • ("2024-01-15", 2) is false

IsLeapYear(value) Returns true if the year is a leap year.

  • 2024 is true

  • 2023 is false

IsAgeGreaterThan(birthDate, years) Returns true if the age calculated from the birthdate is greater than the specified number of years.

  • ("2000-01-01",18) is true

  • ("2010-01-01", 18) is false

IsAgeLessThan(birthDate, years) Returns true if the age calculated from birthDate is less than the specified years.

  • ("2010-01-01",18) is true

  • ("2000-01-01", 18) is false

IsAgeBetween(birthDate, minYears, maxYears) Returns true if the age calculated from birthDate is between minimum and maximum number of years (inclusive).

  • ("2005-01-01", 18, 25) is true

  • ("2010-01-01", 18, 25) is false

IsNull(value) Returns true if the value is null or undefined.

  • null is true

  • "2024-03-15" is false

IsNotNull(value) Returns true if the value is not null or undefined.

  • "2024-03-15" is true

  • null is false