Function useLocale

  • Get the locale returned by the root route loader under the locale key.

    Parameters

    • localeKey: string = "locale"

    Returns string

    let locale = useLocale()
    let formattedDate = date.toLocaleDateString(locale);
    let locale = useLocale("language")
    let formattedDate = date.toLocaleDateString(locale);