Expo
iOSAndroid
Overview
KivaFieldDatetime is a convenience wrapper around KivaFieldDate with mode="datetime" always set. It presents both a date and time picker in a single interaction.
Installation
pnpm dlx @kivacore/ui-cli add @kivacore/rn-form-fields# Required: @react-native-community/datetimepicker
npx expo install @react-native-community/datetimepickerRequired Packages(1 package)
pnpm add @react-native-community/datetimepickerUsage
import { KivaFieldDatetime } from '@/components/kiva-native/form-fields/kiva-field-datetime';
const [dateTime, setDateTime] = useState<Date | null>(null);
<KivaFieldDatetime
name="meeting"
label="Meeting Time"
value={dateTime}
onChange={setDateTime}
dateFormat="long"
timeFormat="24h"
/>API Reference
All props from KivaFieldDate except mode (always 'datetime').
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | null | null | Selected date and time |
onChange | (date: Date | null) => void | — | Called when value changes |
minimumDate | Date | — | Minimum selectable date |
maximumDate | Date | — | Maximum selectable date |
dateFormat | 'short' | 'medium' | 'long' | 'full' | 'medium' | Date format preset |
timeFormat | '12h' | '24h' | '12h' | Time format |
clearable | boolean | true | Show clear button |
Inherits all KivaFieldBaseProps (name, label, placeholder, helpText, required, disabled, readOnly, error, size, variant, etc.)
Type Exports
| Type | Description |
|---|---|
KivaFieldDatetimeProps | Omit<KivaFieldDateProps, 'mode'> |