diff options
author | Sebastian <sebasjm@gmail.com> | 2024-07-31 12:04:27 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-07-31 12:04:27 -0300 |
commit | 3fd51ec65de79ac50be0e927a29eeb281ce15aff (patch) | |
tree | 04cc9267a7194cfd2a1bc58365f17c7bd2022ec5 | |
parent | f0e6ba86795d3669e10e5d108d849f9985dbb6c9 (diff) |
add support to taler proto duration
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx b/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx index d51aa84c4..5988a9197 100644 --- a/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx +++ b/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx @@ -52,7 +52,10 @@ export function InputDuration<T>({ const { error, required, value: anyValue, onChange } = useField<T>(name); let strValue = ""; - const value: Duration = anyValue; + const value: Duration = + anyValue.d_us !== undefined + ? Duration.fromTalerProtocolDuration(anyValue) + : anyValue; if (!value) { strValue = ""; } else if (value.d_ms === "forever") { |