diff options
author | Sebastian <sebasjm@gmail.com> | 2023-05-22 10:40:13 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-05-22 10:40:13 -0300 |
commit | 3e95ae356a98d01e523bdf48547db4114ff224fe (patch) | |
tree | 7cc1e488b902bb3a3eeba92ff81ea0e383ed542d /packages/exchange-backoffice-ui/src/handlers/InputDate.tsx | |
parent | 0544b8358af68df87dbc472221d8c0842c2b2db0 (diff) | |
download | wallet-core-3e95ae356a98d01e523bdf48547db4114ff224fe.tar.gz wallet-core-3e95ae356a98d01e523bdf48547db4114ff224fe.tar.bz2 wallet-core-3e95ae356a98d01e523bdf48547db4114ff224fe.zip |
fix break on build
Diffstat (limited to 'packages/exchange-backoffice-ui/src/handlers/InputDate.tsx')
-rw-r--r-- | packages/exchange-backoffice-ui/src/handlers/InputDate.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/exchange-backoffice-ui/src/handlers/InputDate.tsx b/packages/exchange-backoffice-ui/src/handlers/InputDate.tsx index 00dd59996..e834b6cdb 100644 --- a/packages/exchange-backoffice-ui/src/handlers/InputDate.tsx +++ b/packages/exchange-backoffice-ui/src/handlers/InputDate.tsx @@ -4,24 +4,26 @@ import { CalendarIcon } from "@heroicons/react/24/outline"; import { VNode, h } from "preact"; import { format, parse } from "date-fns"; -export function InputDate( - props: { pattern?: string } & UIFormProps<AbsoluteTime>, +export function InputDate<T extends object, K extends keyof T>( + props: { pattern?: string } & UIFormProps<T, K>, ): VNode { const pattern = props.pattern ?? "dd/MM/yyyy"; return ( - <InputLine<AbsoluteTime> + <InputLine<T, K> type="text" after={{ type: "icon", icon: <CalendarIcon class="h-6 w-6" />, }} converter={{ - fromStringUI: (v) => { + //@ts-ignore + fromStringUI: (v): AbsoluteTime => { if (!v) return { t_ms: "never" }; const t_ms = parse(v, pattern, Date.now()).getTime(); return { t_ms }; }, - toStringUI: (v) => { + //@ts-ignore + toStringUI: (v: AbsoluteTime) => { return !v || !v.t_ms ? "" : v.t_ms === "never" |