Hex Core JS
    Preparing search index...

    Function stringToLocalDate

    • Converts the given date string value (in ISO format) to a Date object. If the given precision is a DatePrecision then the returned date have the time 00:00:00 in local time.

      Designed to handle issues when displaying dates with precision restrictions and handling time zones. Should generally be used only for presentation purposes, not for actual data manipulation.

      Parameters

      • value: null

        The date string to convert.

      • precision: DateTimePrecision

        The precision of the output. Any information in the string after the precision is lost.

      Returns null

    • Converts the given datetime string value (in ISO format) to a Date object. If the given precision is a DatePrecision then the returned date have the time 00:00:00 in local time.

      Designed to handle issues when displaying dates with precision restrictions and handling time zones. Should generally be used only for presentation purposes, not for actual data manipulation.

      Parameters

      • value: string

        The date string (in ISO format) to convert.

      • precision: DateTimePrecision

        The precision of the output. Any information in the string after the precision is lost.

      Returns Date

    • Converts the given datetime string value (in ISO format) to a Date object. If the given precision is a DatePrecision then the returned date have the time 00:00:00 in local time. Returns null if the given value is null.

      Designed to handle issues when displaying dates with precision restrictions and handling time zones. Should generally be used only for presentation purposes, not for actual data manipulation.

      Parameters

      • value: string | null

        The date string (in ISO format) to convert.

      • precision: DateTimePrecision

        The precision of the output. Any information in the string after the precision is lost.

      Returns Date | null