1/** 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 * 7 * @format 8 */ 9 10import type * as React from 'react'; 11import {Constructor} from '../../../types/private/Utilities'; 12import {NativeMethods} from '../../../types/public/ReactNativeTypes'; 13import {ViewProps} from '../View/ViewPropTypes'; 14 15export interface DatePickerIOSProps extends ViewProps { 16 /** 17 * The currently selected date. 18 */ 19 date?: Date | null | undefined; 20 21 /** 22 * Provides an initial value that will change when the user starts selecting 23 * a date. It is useful for simple use-cases where you do not want to deal 24 * with listening to events and updating the date prop to keep the 25 * controlled state in sync. The controlled state has known bugs which 26 * causes it to go out of sync with native. The initialDate prop is intended 27 * to allow you to have native be source of truth. 28 */ 29 initialDate?: Date | null | undefined; 30 31 /** 32 * The date picker locale. 33 */ 34 locale?: string | undefined; 35 36 /** 37 * Maximum date. 38 * Restricts the range of possible date/time values. 39 */ 40 maximumDate?: Date | undefined; 41 42 /** 43 * Maximum date. 44 * Restricts the range of possible date/time values. 45 */ 46 minimumDate?: Date | undefined; 47 48 /** 49 * enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) 50 * The interval at which minutes can be selected. 51 */ 52 minuteInterval?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30 | undefined; 53 54 /** 55 * enum('date', 'time', 'datetime') 56 * The date picker mode. 57 */ 58 mode?: 'date' | 'time' | 'datetime' | undefined; 59 60 /** 61 * Date change handler. 62 * This is called when the user changes the date or time in the UI. 63 * The first and only argument is a Date object representing the new date and time. 64 */ 65 onDateChange: (newDate: Date) => void; 66 67 /** 68 * Timezone offset in minutes. 69 * By default, the date picker will use the device's timezone. With this parameter, it is possible to force a certain timezone offset. 70 * For instance, to show times in Pacific Standard Time, pass -7 * 60. 71 */ 72 timeZoneOffsetInMinutes?: number | undefined; 73 74 /** 75 * The date picker style 76 * This is only available on devices with iOS 14.0 and later. 77 * 'spinner' is the default style if this prop isn't set. 78 */ 79 pickerStyle?: 'compact' | 'spinner' | 'inline' | undefined; 80} 81 82declare class DatePickerIOSComponent extends React.Component<DatePickerIOSProps> {} 83declare const DatePickerIOSBase: Constructor<NativeMethods> & 84 typeof DatePickerIOSComponent; 85 86/** 87 * DatePickerIOS has been merged with DatePickerAndroid and will be removed in a future release. 88 * It can now be installed and imported from `@react-native-community/datetimepicker` instead of 'react-native'. 89 * @see https://github.com/react-native-community/datetimepicker 90 * @deprecated 91 */ 92export class DatePickerIOS extends DatePickerIOSBase {} 93