fix: configure luxon

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-04-04 21:52:59 +02:00
parent 78fde4ff55
commit c0d4d233da
2 changed files with 19 additions and 0 deletions

View file

@ -13,10 +13,13 @@ import { BaseHead } from '../components/layout/base-head'
import { UiNotificationBoundary } from '../components/notifications/ui-notification-boundary'
import { StoreProvider } from '../redux/store-provider'
import { BaseUrlFromEnvExtractor } from '../utils/base-url-from-env-extractor'
import { configureLuxon } from '../utils/configure-luxon'
import { ExpectedOriginBoundary } from '../utils/uri-origin-boundary'
import type { AppInitialProps, AppProps } from 'next/app'
import React from 'react'
configureLuxon()
interface AppPageProps {
baseUrls: BaseUrls | undefined
}

View file

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Settings } from 'luxon'
export const configureLuxon = () => {
Settings.throwOnInvalid = true
}
declare module 'luxon' {
interface TSSettings {
throwOnInvalid: true
}
}