Edit page

DateTime Input

Base on Input

Related component

  • https://www.npmjs.com/package/react-datetime

Basic usage

Install moment

npm install moment --save
or
yarn add moment
import { DateTimeInput } from '@doopage/react-ui-kit'
const Example = () => <DateTimeInput label={'DateTime Input'}/>;
export default Example;

Playground

Normal

August 2021
SuMoTuWeThFrSa
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

Native

Properties

Prop nameTypeDefaultRequiredDescription
onChange((value?: string | undefined) => void) | undefinedfalse
inputPropsInputProps | undefinedfalse
loadingboolean | undefinedfalse
hideboolean | undefinedfalse
helperTextstring | undefinedfalse
errorstring | undefinedfalse
labelstring | undefinedfalse
placeholderstring | undefinedfalse
nativeboolean | undefinedfalse
classNamestring | undefinedfalse
inputboolean | undefinedfalse
renderInput((props: any, openCalendar: Function, closeCalendar: Function) => Element) | undefinedfalse
onCloseEventOrValueHandler<FocusEvent<any>> | undefinedfalse
onOpen((event: FocusEvent<any>) => void) | undefinedfalse
openboolean | undefinedfalse
valuestring | Date | Moment | undefinedfalse
localestring | undefinedfalse
initialValuestring | Date | Moment | undefinedfalse
initialViewDatestring | Date | Moment | undefinedfalse
initialViewMode"time" | "months" | "years" | "days" | undefinedfalse
updateOnViewstring | undefinedfalse
dateFormatstring | boolean | undefinedfalse
timeFormatstring | boolean | undefinedfalse
utcboolean | undefinedfalse
displayTimeZonestring | undefinedfalse
onNavigate((viewMode: string) => void) | undefinedfalse
onBeforeNavigate((nextView: string, currentView: string, viewDate: Moment) => string) | undefinedfalse
onNavigateBack((amount: number, type: string) => void) | undefinedfalse
onNavigateForward((amount: number, type: string) => void) | undefinedfalse
isValidDate((currentDate: any, selectedDate: any) => boolean) | undefinedfalse
renderView((viewMode: string, renderCalendar: Function) => Element) | undefinedfalse
renderDay((props: any, currentDate: any, selectedDate: any) => Element) | undefinedfalse
renderMonth((props: any, month: number, year: number, selectedDate: any) => Element) | undefinedfalse
renderYear((props: any, year: number, selectedDate: any) => Element) | undefinedfalse
strictParsingboolean | undefinedfalse
closeOnSelectboolean | undefinedfalse
timeConstraintsTimeConstraints | undefinedfalse
closeOnClickOutsideboolean | undefinedfalse