updated defenitions for react-dates v10.0.1

specified moment object type
This commit is contained in:
Artur-A
2017-04-11 00:28:45 +03:00
parent 243d9b9b28
commit 897b6d1969
2 changed files with 191 additions and 512 deletions
+150 -264
View File
@@ -1,8 +1,8 @@
// Type definitions for react-dates v7.0.1
// Type definitions for react-dates v10.0.1
// Project: https://github.com/airbnb/react-dates
// Definitions by: Artur Ampilogov <https://github.com/Artur-A>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
// TypeScript Version: 2.2
import * as React from "react";
import * as moment from "moment";
@@ -10,7 +10,7 @@ import * as moment from "moment";
export = ReactDates;
declare namespace momentPropTypes{
type momentObj = any;
type momentObj = moment.Moment;
type momentString = any;
type momentDurationObj = any;
}
@@ -18,54 +18,93 @@ declare namespace momentPropTypes{
declare namespace ReactDates{
type AnchorDirectionShape = 'left' | 'right';
type FocusedInputShape = 'startDate' | 'endDate' | null;
type FocusedInputShape = 'startDate' | 'endDate';
type OrientationShape = 'horizontal' | 'vertical';
type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable';
interface DateRangePickerShape{
startDate?: momentPropTypes.momentObj,
endDate?: momentPropTypes.momentObj,
focusedInput?: FocusedInputShape,
screenReaderInputMessage?: string,
minimumNights?: number,
isDayBlocked?: (day: any) => boolean,
isOutsideRange?: (day: any) => boolean,
enableOutsideDays?: boolean,
reopenPickerOnClearDates?: boolean,
keepOpenOnDateSelect?: boolean,
numberOfMonths?: number,
showClearDates?: boolean,
disabled?: boolean,
required?: boolean,
showDefaultInputIcon?: boolean,
orientation?: OrientationShape,
anchorDirection?: AnchorDirectionShape,
horizontalMargin?: number,
// portal options
withPortal?: boolean,
withFullScreenPortal?: boolean,
// REQUIRED props
startDate: momentPropTypes.momentObj | null,
endDate: momentPropTypes.momentObj | null,
onDatesChange: (arg: { startDate: momentPropTypes.momentObj | null,
endDate: momentPropTypes.momentObj | null }
) => void,
focusedInput: FocusedInputShape | null,
onFocusChange: (arg: FocusedInputShape | null) => void,
// input related props
startDateId?: string,
startDatePlaceholderText?: string,
endDateId?: string,
endDatePlaceholderText?: string,
disabled?: boolean,
required?: boolean,
screenReaderInputMessage?: string,
showClearDates?: boolean,
showDefaultInputIcon?: boolean,
customInputIcon?: string | JSX.Element,
customArrowIcon?: string | JSX.Element,
customCloseIcon?: string | JSX.Element,
initialVisibleMonth?: () => moment.Moment,
onDatesChange?: (arg: { startDate: any, endDate: any }) => void,
onFocusChange?: (arg: FocusedInputShape) => void,
// calendar presentation and interaction related props
orientation?: OrientationShape,
anchorDirection?: AnchorDirectionShape,
horizontalMargin?: number,
withPortal?: boolean,
withFullScreenPortal?: boolean,
initialVisibleMonth?: () => momentPropTypes.momentObj,
numberOfMonths?: number,
keepOpenOnDateSelect?: boolean,
reopenPickerOnClearDates?: boolean,
renderCalendarInfo?: () => (string | JSX.Element),
// navigation related props
navPrev?: string | JSX.Element,
navNext?: string | JSX.Element,
onPrevMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
onNextMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
renderDay?: (day: any) => (string | JSX.Element),
// day presentation and interaction related props
renderDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
minimumNights?: number,
enableOutsideDays?: boolean,
isDayBlocked?: (day: any) => boolean,
isOutsideRange?: (day: any) => boolean,
isDayHighlighted?: (day: any) => boolean,
// i18n
// internationalization props
displayFormat?: (string | (()=> string)),
monthFormat?: string,
phrases?: {
closeDatePicker: string | JSX.Element,
clearDates: string | JSX.Element,
closeDatePicker: string,
clearDates: string,
focusStartDate: string,
jumpToPrevMonth: string,
jumpToNextMonth: string,
keyboardShortcuts: string,
showKeyboardShortcutsPanel: string,
hideKeyboardShortcutsPanel: string,
openThisPanel: string,
enterKey: string,
leftArrowRightArrow: string,
upArrowDownArrow: string,
pageUpPageDown: string,
homeEnd: string,
escape: string,
questionMark: string,
selectFocusedDate: string,
moveFocusByOneDay: string,
moveFocusByOneWeek: string,
moveFocusByOneMonth: string,
moveFocustoStartAndEndOfWeek: string,
returnFocusToInput: string,
keyboardNavigationInstructions: string,
chooseAvailableStartDate: (date: string) => string,
chooseAvailableEndDate: (date: string) => string,
dateIsUnavailable: (date: string) => string
}
}
@@ -73,46 +112,77 @@ declare namespace ReactDates{
var DateRangePicker: React.ClassicComponentClass<DateRangePickerShape>;
interface SingleDatePickerShape{
// REQUIRED props
date: momentPropTypes.momentObj | null,
onDateChange: (date: momentPropTypes.momentObj | null) => void,
focused: boolean,
onFocusChange: (arg: { focused: boolean | null }) => void,
id: string,
// input related props
placeholder?: string,
date?: momentPropTypes.momentObj,
focused?: boolean,
showClearDate?: boolean,
reopenPickerOnClearDates?: boolean,
keepOpenOnDateSelect?: boolean,
disabled?: boolean,
required?: boolean,
screenReaderInputMessage?: string,
showClearDate?: boolean,
customCloseIcon?: string | JSX.Element,
onDateChange?: (date: any) => void,
onFocusChange?: (arg: { focused: boolean | null }) => void,
isDayBlocked?: (day: any) => boolean,
isOutsideRange?: (day: any) => boolean,
enableOutsideDays?: boolean,
numberOfMonths?: number,
// calendar presentation and interaction related props
orientation?: OrientationShape,
initialVisibleMonth?: () => moment.Moment,
anchorDirection?: AnchorDirectionShape,
horizontalMargin?: number,
navPrev?: string | JSX.Element,
navNext?: string | JSX.Element,
// portal options
withPortal?: boolean,
withFullScreenPortal?: boolean,
initialVisibleMonth?: () => momentPropTypes.momentObj,
numberOfMonths?: number,
keepOpenOnDateSelect?: boolean,
reopenPickerOnClearDates?: boolean,
renderCalendarInfo?: () => (string | JSX.Element),
// navigation related props
navPrev?: string | JSX.Element,
navNext?: string | JSX.Element,
onPrevMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
onNextMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
renderDay?: (day: any) => (string | JSX.Element),
// day presentation and interaction related props
renderDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
enableOutsideDays?: boolean,
isDayBlocked?: (day: any) => boolean,
isOutsideRange?: (day: any) => boolean,
isDayHighlighted?: (day: any) => boolean,
// i18n
// internationalization props
displayFormat?: (string | (()=> string)),
monthFormat?: string,
phrases?: {
closeDatePicker: string | JSX.Element,
closeDatePicker: string,
clearDate: string,
jumpToPrevMonth: string,
jumpToNextMonth: string,
keyboardShortcuts: string,
showKeyboardShortcutsPanel: string,
hideKeyboardShortcutsPanel: string,
openThisPanel: string,
enterKey: string,
leftArrowRightArrow: string,
upArrowDownArrow: string,
pageUpPageDown: string,
homeEnd: string,
escape: string,
questionMark: string,
selectFocusedDate: string,
moveFocusByOneDay: string,
moveFocusByOneWeek: string,
moveFocusByOneMonth: string,
moveFocustoStartAndEndOfWeek: string,
returnFocusToInput: string,
keyboardNavigationInstructions: string,
chooseAvailableDate: (date: string) => string,
dateIsUnavailable: (date: string) => string,
},
}
type SingleDatePicker = React.ClassicComponentClass<SingleDatePickerShape>;
@@ -120,236 +190,52 @@ declare namespace ReactDates{
interface DateRangePickerInputControllerShape {
startDate?: momentPropTypes.momentObj,
startDateId?: string,
startDatePlaceholderText?: string,
isStartDateFocused?: boolean,
interface DayPickerRangeControllerShape {
// REQUIRED props
startDate: momentPropTypes.momentObj | null,
endDate: momentPropTypes.momentObj | null,
onDatesChange: (arg: { startDate: momentPropTypes.momentObj | null,
endDate: momentPropTypes.momentObj | null }
) => void,
focusedInput: FocusedInputShape | null,
onFocusChange: (arg: FocusedInputShape | null) => void,
endDate?: momentPropTypes.momentObj,
endDateId?: string,
endDatePlaceholderText?: string,
isEndDateFocused?: boolean,
screenReaderMessage?: string,
showClearDates?: boolean,
showCaret?: boolean,
showDefaultInputIcon?: boolean,
disabled?: boolean,
required?: boolean,
keepOpenOnDateSelect?: boolean,
reopenPickerOnClearDates?: boolean,
withFullScreenPortal?: boolean,
isOutsideRange?: (day: any) => boolean,
displayFormat?: (string | (()=> string)),
onFocusChange?: (arg: FocusedInputShape) => void,
onDatesChange?: (arg: { startDate: any, endDate: any }) => void,
customInputIcon?: string | JSX.Element,
customArrowIcon?: string | JSX.Element,
// i18n
phrases?: {
clearDates: string | JSX.Element,
}
}
type DateRangePickerInputController = React.ClassicComponentClass<DateRangePickerInputControllerShape>;
var DateRangePickerInputController: React.ClassicComponentClass<DateRangePickerInputControllerShape>;
interface DateRangePickerInputShape{
startDateId?: string,
startDatePlaceholderText?: string,
screenReaderMessage?: string,
endDateId?: string,
endDatePlaceholderText?: string,
onStartDateFocus?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
onEndDateFocus?: (e: React.EventHandler<React.FocusEvent<HTMLInputElement>>) => void,
onStartDateChange?: (e: React.EventHandler<React.FormEvent<HTMLInputElement>>) => void,
onEndDateChange?: (e: React.EventHandler<React.FormEvent<HTMLInputElement>>) => void,
onStartDateShiftTab?: (e: React.EventHandler<React.KeyboardEvent<HTMLInputElement>>) => void,
onEndDateTab?: (e: React.EventHandler<React.KeyboardEvent<HTMLInputElement>>) => void,
onClearDates?: (e: React.EventHandler<React.MouseEvent<HTMLButtonElement>>) => void,
startDate?: string,
startDateValue?: string,
endDate?: string,
endDateValue?: string,
isStartDateFocused?: boolean,
isEndDateFocused?: boolean,
showClearDates?: boolean,
disabled?: boolean,
required?: boolean,
showCaret?: boolean,
showDefaultInputIcon?: boolean,
customInputIcon?: string | JSX.Element,
customArrowIcon?: string | JSX.Element,
// i18n
phrases?:{
clearDates: string | JSX.Element,
},
}
type DateRangePickerInput = React.ClassicComponentClass<DateRangePickerInputShape>;
var DateRangePickerInput: React.ClassicComponentClass<DateRangePickerInputShape>;
interface SingleDatePickerInputShape{
id: string,
placeholder?: string, // also used as label
displayValue?: string,
inputValue?: string,
screenReaderMessage?: string,
focused?: boolean,
disabled?: boolean,
required?: boolean,
showCaret?: boolean,
showClearDate?: boolean,
onChange?: (e: React.EventHandler<React.FormEvent<HTMLInputElement>>) => void,
onClearDate?: (e: React.EventHandler<React.MouseEvent<HTMLButtonElement>>) => void,
onFocus?: (e: React.EventHandler<React.FocusEvent<HTMLInputElement>>) => void,
onKeyDownShiftTab?: (e: React.EventHandler<React.KeyboardEvent<HTMLInputElement>>) => void,
onKeyDownTab?: (e: React.EventHandler<React.KeyboardEvent<HTMLInputElement>>) => void,
// i18n
phrases?: {
clearDate: string | JSX.Element,
}
}
type SingleDatePickerInput = React.ClassicComponentClass<SingleDatePickerInputShape>;
var SingleDatePickerInput: React.ClassicComponentClass<SingleDatePickerInputShape>;
interface DayPickerShape{
// calendar presentation and interaction related props
enableOutsideDays?: boolean,
numberOfMonths?: number,
modifiers?: any,
orientation?: ScrollableOrientationShape,
withPortal?: boolean,
hidden?: boolean,
initialVisibleMonth?: () => moment.Moment,
initialVisibleMonth?: () => momentPropTypes.momentObj,
renderCalendarInfo?: () => (string | JSX.Element),
onOutsideClick?: (e: any) => void,
keepOpenOnDateSelect?: boolean,
// navigation related props
navPrev?: string | JSX.Element,
navNext?: string | JSX.Element,
onDayClick?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseEnter?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseLeave?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onPrevMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
onNextMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
onOutsideClick?: (e: MouseEvent) => void,
renderDay?: (day: any) => (string | JSX.Element),
// i18n
monthFormat?: string,
}
type DayPicker = React.ClassicComponentClass<DayPickerShape>;
var DayPicker: React.ClassicComponentClass<DayPickerShape>;
interface DayPickerRangeControllerShape{
startDate?: momentPropTypes.momentObj,
endDate?: momentPropTypes.momentObj,
onDatesChange?: (arg: { startDate: any, endDate: any }) => void,
focusedInput?: FocusedInputShape,
onFocusChange?: (arg: FocusedInputShape) => void,
keepOpenOnDateSelect?: boolean,
// day presentation and interaction related props
renderDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
minimumNights?: number,
isOutsideRange?: (day: any) => boolean,
isDayBlocked?: (day: any) => boolean,
isDayHighlighted?: (day: any) => boolean,
// DayPicker props
enableOutsideDays?: boolean,
numberOfMonths?: number,
orientation?: ScrollableOrientationShape,
withPortal?: boolean,
hidden?: boolean,
initialVisibleMonth?: () => moment.Moment,
navPrev?: string | JSX.Element,
navNext?: string | JSX.Element,
onPrevMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
onNextMonthClick?: (e: React.EventHandler<React.MouseEvent<HTMLSpanElement>>) => void,
onOutsideClick?: (e: MouseEvent) => void,
renderDay?: (day: any) => (string | JSX.Element),
// i18n
// internationalization props
monthFormat?: string,
phrases?: {
focusStartDate: string,
clearDates: string,
keyboardNavigationInstructions: string,
}
}
type DayPickerRangeController = React.ClassicComponentClass<DayPickerRangeControllerShape>;
var DayPickerRangeController: React.ClassicComponentClass<DayPickerRangeControllerShape>;
interface CalendarMonthGridShape{
enableOutsideDays?: boolean,
firstVisibleMonthIndex?: number,
initialMonth?: momentPropTypes.momentObj,
isAnimating?: boolean,
numberOfMonths?: number,
modifiers?: any,
orientation?: ScrollableOrientationShape,
onDayClick?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseEnter?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseLeave?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onMonthTransitionEnd?: ()=> void,
renderDay?: (day: any) => (string | JSX.Element),
transformValue?: string,
// i18n
monthFormat?: string,
}
type CalendarMonthGrid = React.ClassicComponentClass<CalendarMonthGridShape>;
var CalendarMonthGrid: React.ClassicComponentClass<CalendarMonthGridShape>;
interface CalendarMonthShape{
month?: momentPropTypes.momentObj,
isVisible?: boolean,
enableOutsideDays?: boolean,
modifiers?: any,
orientation?: ScrollableOrientationShape,
onDayClick?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseEnter?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseLeave?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
renderDay?: (day: any) => (string | JSX.Element),
// i18n
monthFormat?: string,
}
type CalendarMonth = React.ClassicComponentClass<CalendarMonthShape>;
var CalendarMonth: React.ClassicComponentClass<CalendarMonthShape>;
interface CalendarDayShape{
day?: momentPropTypes.momentObj,
isOutsideDay?: boolean,
modifiers?: any,
onDayClick?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseEnter?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
onDayMouseLeave?: (day: any, e: React.EventHandler<React.MouseEvent<HTMLTableDataCellElement>>) => void,
renderDay?: (day: any) => (string | JSX.Element),
}
type CalendarDay = React.ClassicComponentClass<CalendarDayShape>;
var CalendarDay: React.ClassicComponentClass<CalendarDayShape>;
var isInclusivelyAfterDay: (a: moment.Moment, b: moment.Moment) => boolean;
+41 -248
View File
@@ -2,16 +2,9 @@ import * as React from "react";
import * as moment from "moment";
import {
CalendarDay,
CalendarMonth,
CalendarMonthGrid,
SingleDatePickerInput,
SingleDatePicker,
DayPicker,
DayPickerRangeController,
DateRangePickerInput,
DateRangePickerInputController,
DateRangePicker,
DateRangePicker,
DayPickerRangeController,
isInclusivelyAfterDay,
isInclusivelyBeforeDay,
isNextDay,
@@ -21,83 +14,17 @@ import {
toMomentObject} from "react-dates";
class CalendarDayRenderingMinimumTest extends React.Component<{}, {}> {
render() {
return <CalendarDay />
}
}
class CalendarDayRenderingFullTest extends React.Component<{}, {}> {
render() {
return <CalendarDay day={moment()}
isOutsideDay={false}
renderDay={day => day.toString()}
onDayClick={(day,e) => {}}
onDayMouseEnter={(day,e) => {}}
onDayMouseLeave={(day,e) => {}}
/>
}
}
class CalendarMonthMinimumTest extends React.Component<{}, {}> {
render() {
return <CalendarMonth />
}
}
class CalendarMonthFullTest extends React.Component<{}, {}> {
render() {
return <CalendarMonth enableOutsideDays={true}
isVisible={true}
month={moment()}
orientation="horizontal"
monthFormat="MM"
renderDay={day => day.toString()}
onDayClick={(day,e) => {}}
onDayMouseEnter={(day,e) => {}}
onDayMouseLeave={(day,e) => {}}
/>
}
}
class SingleDatePickerInputMinimumTest extends React.Component<{}, {}> {
render() {
return <SingleDatePickerInput id="SingleDatePickerInput" />
}
}
class SingleDatePickerInputFullTest extends React.Component<{}, {}> {
render() {
return <SingleDatePickerInput
id="SingleDatePickerInput"
disabled={false}
displayValue="SingleDatePicker"
focused={false}
inputValue="test"
onChange={e => {}}
onClearDate={e => {}}
onFocus={e => {}}
onKeyDownShiftTab={e => {}}
onKeyDownTab={e => {}}
phrases={{clearDate: "clear"}}
placeholder="test"
required={false}
screenReaderMessage="arial-test"
showCaret={true}
showClearDate={true}
/>
}
}
class SingleDatePickerMinimumTest extends React.Component<{}, {}> {
render() {
return <SingleDatePicker id="SingleDatePickerInput" />
return <SingleDatePicker
id="SingleDatePickerInput"
date={moment()}
onDateChange={d => {}}
focused={false}
onFocusChange={arg => {}}
/>
}
}
@@ -123,7 +50,6 @@ class SingleDatePickerFullTest extends React.Component<{}, {}> {
withPortal={false}
onDateChange={d => {}}
focused={false}
phrases={{closeDatePicker: <span>Close</span>}}
reopenPickerOnClearDates={true}
screenReaderInputMessage="arial-test"
withFullScreenPortal={true}
@@ -138,173 +64,19 @@ class SingleDatePickerFullTest extends React.Component<{}, {}> {
}
}
class DayPickerRangeControllerMinimumTest extends React.Component<{}, {}> {
render() {
return <DayPickerRangeController />
}
}
class DayPickerRangeControllerFullTest extends React.Component<{}, {}> {
render() {
return <DayPickerRangeController
startDate={moment()}
endDate={moment()}
focusedInput="startDate"
initialVisibleMonth={() => moment()}
hidden={false}
isDayBlocked={(day:any)=> false}
isDayHighlighted={(day:any)=> false}
isOutsideRange={(day:any)=> false}
keepOpenOnDateSelect={true}
minimumNights={3}
navNext="next"
navPrev="prev"
withPortal={false}
onDatesChange={arg => {}}
onFocusChange={arg => {}}
onNextMonthClick={e => {}}
onPrevMonthClick={e => {}}
onOutsideClick={e => {}}
enableOutsideDays={true}
numberOfMonths={2}
orientation="horizontal"
monthFormat="MM"
renderDay={day => day.toString()}
/>
}
}
class DayPickerTest extends React.Component<{}, {}> {
render() {
return <DayPicker />
}
}
class DayPickerFullTest extends React.Component<{}, {}> {
render() {
return <DayPicker
onDayClick={(day,e)=> {}}
onDayMouseEnter={(day,e)=>{}}
onDayMouseLeave={(day,e)=>{}}
initialVisibleMonth={() => moment()}
hidden={false}
navNext="next"
navPrev="prev"
withPortal={false}
onNextMonthClick={e => {}}
onPrevMonthClick={e => {}}
onOutsideClick={e => {}}
enableOutsideDays={true}
numberOfMonths={2}
orientation="horizontal"
monthFormat="MM"
renderDay={day => day.toString()}
/>
}
}
class DateRangePickerInputMinimumTest extends React.Component<{}, {}> {
render() {
return <DateRangePickerInput startDateId="id1" endDateId="id2" />
}
}
class DateRangePickerInputFullTest extends React.Component<{}, {}> {
render() {
return <DateRangePickerInput
customArrowIcon="<"
customInputIcon=">"
disabled={false}
startDateId="id1"
endDateId="id2"
startDateValue={"1.1.2020"}
endDateValue={"1.1.2020"}
startDatePlaceholderText="placeholder"
endDatePlaceholderText="placeholder"
isEndDateFocused={false}
isStartDateFocused={false}
onClearDates={e => {}}
onEndDateChange={e => {}}
onEndDateFocus={e => {}}
onEndDateTab={e => {}}
onStartDateChange={e => {}}
onStartDateFocus={e => {}}
onStartDateShiftTab={e => {}}
showDefaultInputIcon={true}
required={false}
screenReaderMessage="arial-test"
showCaret={true}
showClearDates={true}
phrases={{clearDates: "clear"}}
/>
}
}
class DateRangePickerInputControllerMinimumTest extends React.Component<{}, {}> {
render() {
return <DateRangePickerInputController startDateId="id1" endDateId="id2" />
}
}
class DateRangePickerInputControllerFullTest extends React.Component<{}, {}> {
render() {
return <DateRangePickerInput
customArrowIcon="<"
customInputIcon=">"
disabled={false}
startDateId="id1"
endDateId="id2"
startDateValue={"1.1.2020"}
endDateValue={"1.1.2020"}
startDatePlaceholderText="placeholder"
endDatePlaceholderText="placeholder"
isEndDateFocused={false}
isStartDateFocused={false}
onClearDates={e => {}}
onEndDateChange={e => {}}
onEndDateFocus={e => {}}
onEndDateTab={e => {}}
onStartDateChange={e => {}}
onStartDateFocus={e => {}}
onStartDateShiftTab={e => {}}
showDefaultInputIcon={true}
required={false}
screenReaderMessage="arial-test"
showCaret={true}
showClearDates={true}
phrases={{clearDates: "clear"}}
startDate="1.1.2020"
endDate="1.1.2020"
/>
}
}
class DateRangePickerMinimumTest extends React.Component<{}, {}> {
render() {
return <DateRangePicker startDateId="id1" endDateId="id2" />
return <DateRangePicker
startDate={moment()}
endDate={moment()}
onDatesChange={(arg)=> {}}
focusedInput="startDate"
onFocusChange={(arg) => {}}
/>
}
}
class DateRangePickerFullTest extends React.Component<{}, {}> {
render() {
return <DateRangePicker
@@ -316,9 +88,8 @@ class DateRangePickerFullTest extends React.Component<{}, {}> {
showDefaultInputIcon={true}
required={false}
showClearDates={true}
phrases={{clearDates: "clear", closeDatePicker: "close"}}
startDate="1.1.2020"
endDate="1.1.2020"
startDate={moment().add(3, 'days')}
endDate={moment().add(5, 'days')}
anchorDirection="left"
focusedInput="startDate"
minimumNights={2}
@@ -345,6 +116,28 @@ class DateRangePickerFullTest extends React.Component<{}, {}> {
}
}
class DayPickerRangeControllerMinimumTest extends React.Component<{}, {}> {
render() {
return <DayPickerRangeController
startDate={moment()}
endDate={moment()}
onDatesChange={(arg)=> {}}
focusedInput="startDate"
onFocusChange={(arg) => {}}
/>
}
}
const isInclusivelyAfterDayResult: boolean = isInclusivelyAfterDay(moment(),moment());
const isInclusivelyBeforeDayResult: boolean = isInclusivelyBeforeDay(moment(),moment());