Variable datetimeConst

datetime: {
    Date: any;
    Time: any;
    DATE_EXPR: RegExp;
    DATE_PLACEHOLDER: "DD/MM/YYYY";
    TIME_EXPR: RegExp;
    TIME_PLACEHOLDER: "HH:MM";
    currentDate: (() => string);
    currentTime: (() => string);
    dateStamp: ((str??: string) => number);
    parseDate: ((date: null | string) => null | Date);
    parseTime: ((time: null | string) => null | Time);
    serializeDate: ((date: null | Date) => null | string);
    serializeTime: ((time: null | Time) => null | string);
    timeStamp: ((str??: string) => number);
} = ...

Type declaration

  • DATE_EXPR: RegExp
  • DATE_PLACEHOLDER: "DD/MM/YYYY"
  • TIME_EXPR: RegExp
  • TIME_PLACEHOLDER: "HH:MM"
  • currentDate: (() => string)

    Retrieves the current date.

      • (): string
      • Returns string

        The current date in serialized format.

  • currentTime: (() => string)

    Generates the current time.

      • (): string
      • Returns string

        The current time as a serialized string.

  • dateStamp: ((str??: string) => number)

    Converts a date string to a timestamp.

      • (str?): number
      • Parameters

        • Optionalstr: string = ...

          The date string to convert.

        Returns number

        • The timestamp if the conversion is successful, -1 otherwise.
  • parseDate: ((date: null | string) => null | Date)

    Parses a string representation of a date in "dd/mm/yyyy" format and returns a Date object. If the input is not in the correct format or is null, returns null.

      • (date): null | Date
      • Parameters

        • date: null | string

          The string representation of the date to parse.

        Returns null | Date

        • The parsed Date object or null if the input is not valid.
  • parseTime: ((time: null | string) => null | Time)

    Parses a string representation of time into a Time object.

      • (time): null | Time
      • Parameters

        • time: null | string

          The string representation of time to parse.

        Returns null | Time

        • The parsed Time object or null if input is null or invalid.
  • serializeDate: ((date: null | Date) => null | string)

    Serialize a given date to a string representation in the format "dd/MM/yyyy".

      • (date): null | string
      • Parameters

        • date: null | Date

          The date to serialize.

        Returns null | string

        The serialized date or null if the input is not a valid Date object.

  • serializeTime: ((time: null | Time) => null | string)

    Serializes the given time object into a string representation.

      • (time): null | string
      • Parameters

        • time: null | Time

          The time object to be serialized.

        Returns null | string

        • The serialized time string, or null if the input is invalid.
  • timeStamp: ((str??: string) => number)

    Converts a string representation of a time to a timestamp.

      • (str?): number
      • Parameters

        • Optionalstr: string = ...

          The time string to convert. Defaults to the current time.

        Returns number

        • The timestamp representation of the given time or -1 if conversion fails.