velocity-ui
    Preparing search index...

    Class DateUtils

    Index

    Constructors

    Methods

    • Add days to a date

      Parameters

      • date: DateInput

        Date to add days to

      • days: number = 0

        Number of days to add (defaults to 0)

      Returns Date

      New date with days added

    • Format date to YYYY-MM-DD

      Parameters

      • date: DateInput

        Date input to format

      Returns string

      Formatted date string or empty string if invalid

    • Format date to YYYY-MM-DDTHH:mm:ss (ISO format, without Z)

      Parameters

      • date: DateInput

        Date input to format

      Returns string

      Formatted datetime string

    • Format time to HH:mm:ss

      Parameters

      • date: DateInput

        Date input to format

      Returns string

      Formatted time string or empty string if invalid

    • Check if a date is in the future

      Parameters

      • date: DateInput

        Date to check

      Returns boolean

      True if date is in the future

    • Check if a date is in the past

      Parameters

      • date: DateInput

        Date to check

      Returns boolean

      True if date is in the past

    • Check if two dates fall on the same day

      Parameters

      • a: DateInput

        First date to compare

      • b: DateInput

        Second date to compare

      Returns boolean

      True if dates are on the same day

    • Check if a date is valid

      Parameters

      • date: any

        Value to check

      Returns boolean

      True if the value represents a valid date

    • Parse a date safely, fallback to null

      Parameters

      • value: any

        Value to parse as date

      Returns null | Date

      Parsed date or null if invalid

    • Subtract days from a date

      Parameters

      • date: DateInput

        Date to subtract days from

      • days: number = 0

        Number of days to subtract (defaults to 0)

      Returns Date

      New date with days subtracted

    • Get today's date without time

      Returns Date

      Today's date with time set to midnight