Skip to content

Commit b1602c4

Browse files
Merge pull request #1107 from milanholemans/allowTextInput
Added allowTextInput property
2 parents d5da327 + 9101445 commit b1602c4

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

docs/documentation/docs/controls/DateTimePicker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The `DateTimePicker` control can be configured with the following properties:
6262
| isMonthPickerVisible | boolean | no | Controls whether the month picker is shown beside the day picker or hidden. |
6363
| showMonthPickerAsOverlay | boolean | no | Show month picker on top of date picker when visible. |
6464
| showWeekNumbers | boolean | no | Controls whether the calendar should show the week number (weeks 1 to 53) before each week row |
65+
| allowTextInput | boolean | no | Whether the user is allowed to enter a date as text instead of picking one from the date picker. |
6566
| strings | IDatePickerStrings | no | Localized strings to use in the DateTimePicker |
6667
| value | Date | no | Default value of the DatePicker, if any |
6768
| onChange | function | no | Callback issued when date or time is changed |

src/controls/dateTimePicker/DateTimePicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
213213
firstDayOfWeek,
214214
isMonthPickerVisible = true,
215215
showGoToToday,
216+
allowTextInput = true,
216217
showMonthPickerAsOverlay = false,
217218
showWeekNumbers = false,
218219
showSeconds = false,
@@ -308,7 +309,7 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
308309
strings={dateStrings}
309310
isMonthPickerVisible={isMonthPickerVisible}
310311
onSelectDate={this.onSelectDate}
311-
allowTextInput={true}
312+
allowTextInput={allowTextInput}
312313
firstDayOfWeek={firstDayOfWeek}
313314
showGoToToday={showGoToToday}
314315
showMonthPickerAsOverlay={showMonthPickerAsOverlay}

src/controls/dateTimePicker/IDateTimePickerProps.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ export interface IDateTimePickerProps {
5959
* Default value is 200.
6060
*/
6161
deferredValidationTime?: number;
62+
/**
63+
* Whether the user is allowed to enter a date as text instead of picking one from the date picker.
64+
* @defaultvalue false
65+
*/
66+
allowTextInput?: boolean;
6267
/**
6368
* Whether the "Go to today" link should be shown or not
6469
*/

0 commit comments

Comments
 (0)