From 29cd645fcf915e560103f248f8fecee5cbe3beb2 Mon Sep 17 00:00:00 2001 From: Viki Date: Tue, 18 Jun 2024 17:33:32 +0800 Subject: [PATCH] docs: modify docs --- src/use-date-format/demo.tsx | 5 +---- src/use-date-format/index.mdx | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/use-date-format/demo.tsx b/src/use-date-format/demo.tsx index 79a73ca2..53923f5b 100644 --- a/src/use-date-format/demo.tsx +++ b/src/use-date-format/demo.tsx @@ -7,10 +7,7 @@ export function App() { const time = useDateFormat(now, 'HH:mm:ss • hh:mm:ss • H:m:s • h:m:s') const input = useControlledComponent("[Today is] M/D/YYYY, ddd, [now is] A H [o'clock] m [min] s [sec] SSS [ms]") - const playground = useDateFormat(now, input.value, { - locales: 'en-US', - customMeridiem: (hours: number) => (hours < 12 ? 'A.M.' : 'P.M.'), - }) + const playground = useDateFormat(now, input.value, { locales: 'en-US' }) return ( diff --git a/src/use-date-format/index.mdx b/src/use-date-format/index.mdx index 1231c793..dcafc429 100644 --- a/src/use-date-format/index.mdx +++ b/src/use-date-format/index.mdx @@ -21,9 +21,9 @@ import source from '!!raw-loader!./demo' {source} -## Formats +## Format Tokens -| Format | Output | Description | +| Token | Output | Description | | ------ | ------------------------ | --------------------------------------- | | `Yo` | 2018th | Ordinal formatted year | | `YY` | 18 | Two-digit year | @@ -100,7 +100,7 @@ export type UseDateFormatOptions = FormatDateOptions & { /** * fallback string when date is invalid */ - fallbackStr?: string + fallback?: string } ```