date-x
    Preparing search index...

    Class DateParser

    It provides the ability to compare date string with custom date format expression.

    Index

    Constructors

    Methods

    • Builds the regular expression based on the given format.

      Parameters

      • format: string

        The date format needs to be checked against.

      • OptionalignoreCase: boolean

        Should the test executed in case sensitive or not.

      • OptionalshouldGroup: boolean

        Should the regular expression grouped or not.

      Returns RegExp

      The regular expression based on the given format.

    • Loads the specific configuration for the given locale. It contains the month and day names and locale specific date format, like: shortDate, etc.

      Parameters

      • locale: SupportedLocale

        The locale needs to be loaded in two-digits format.

      Returns void

    • It tests whether the given dateString matches the given date format and returns the matched parts of the dateString. The test is case sensitive, be default, but with ignoraCase parameter it could be set to case insensitive.

      Parameters

      • format: string

        The date format needs to be checked against.

      • dateString: string

        The date string needs to be fixed.

      • OptionalignoreCase: boolean = false

        Should the test executed in case sensitive or not.

      Returns RegExpMatchArray

      The matched groups or null if it doesn't match.

    • It tests whether the given dateString matches the given date format. The test is case sensitive, be default, but with ignoraCase parameter it could be set to case insensitive.

      Parameters

      • format: string

        The date format needs to be checked against.

      • dateString: string

        The date string needs to be fixed.

      • OptionalignoreCase: boolean = false

        Should the test executed in case sensitive or not.

      Returns boolean

      True if the dateString matches the given format.