about summary refs log tree commit diff
path: root/src/components/forms/DateField/index.web.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/forms/DateField/index.web.tsx')
-rw-r--r--src/components/forms/DateField/index.web.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/forms/DateField/index.web.tsx b/src/components/forms/DateField/index.web.tsx
index b764620e3..057ea1673 100644
--- a/src/components/forms/DateField/index.web.tsx
+++ b/src/components/forms/DateField/index.web.tsx
@@ -1,6 +1,6 @@
 import React from 'react'
 import {StyleSheet, TextInput, TextInputProps} from 'react-native'
-// @ts-ignore
+// @ts-expect-error untyped
 import {unstable_createElement} from 'react-native-web'
 
 import {DateFieldProps} from '#/components/forms/DateField/types'
@@ -39,6 +39,7 @@ export function DateField({
   isInvalid,
   testID,
   accessibilityHint,
+  maximumDate,
 }: DateFieldProps) {
   const handleOnChange = React.useCallback(
     (e: any) => {
@@ -56,12 +57,14 @@ export function DateField({
     <TextField.Root isInvalid={isInvalid}>
       <TextField.Icon icon={CalendarDays} />
       <Input
-        value={value}
+        value={toSimpleDateString(value)}
         label={label}
         onChange={handleOnChange}
         onChangeText={() => {}}
         testID={testID}
         accessibilityHint={accessibilityHint}
+        // @ts-expect-error not typed as <input type="date"> even though it is one
+        max={maximumDate ? toSimpleDateString(maximumDate) : undefined}
       />
     </TextField.Root>
   )