Skip to content

Commit 5ac698d

Browse files
committed
Merge branch 'PrasadKasireddy-PrasadKasireddy-patch-1' into dev
2 parents 1082767 + 57bfb24 commit 5ac698d

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

docs/documentation/docs/controls/DateTimePicker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The `DateTimePicker` control can be configured with the following properties:
6868
| showSeconds | boolean | no | Specifies, if seconds dropdown should be shown, defaults to false. |
6969
| timeDisplayControlType | TimeDisplayControlType | no | Specifies what type of control to use when rendering time part. |
7070
| showLabels | boolean | no | Specifies if labels in front of date and time parts should be rendered. |
71+
| placeholder | string | no | Placeholder text for the DatePicker. |
7172

7273
Enum `TimeDisplayControlType`
7374

src/controls/dateTimePicker/DateTimePicker.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
204204
value = this.state.day,
205205
strings: dateStrings = new DateTimePickerStrings(), // Defines the DatePicker control labels
206206
timeDisplayControlType,
207+
placeholder,
207208
showLabels
208209
} = this.props;
209210

@@ -291,6 +292,7 @@ export class DateTimePicker extends React.Component<IDateTimePickerProps, IDateT
291292
showGoToToday={showGoToToday}
292293
showMonthPickerAsOverlay={showMonthPickerAsOverlay}
293294
showWeekNumbers={showWeekNumbers}
295+
placeholder={placeholder}
294296
/>
295297
</div>
296298
</div>

src/controls/dateTimePicker/IDateTimePickerProps.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,9 @@ export interface IDateTimePickerProps {
102102
* Specify if labels in front of date and time parts should be rendered. True by default
103103
*/
104104
showLabels?: boolean;
105+
106+
/**
107+
* Placeholder text for the DatePicker
108+
*/
109+
placeholder?: string;
105110
}

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
450450
} />
451451

452452

453-
<DateTimePicker label="DateTime Picker (unspecified = date and time)" isMonthPickerVisible={false} showSeconds={false} onChange={(value) => console.log("DateTimePicker value:", value)} />
453+
<DateTimePicker label="DateTime Picker (unspecified = date and time)" isMonthPickerVisible={false} showSeconds={false} onChange={(value) => console.log("DateTimePicker value:", value)} placeholder="Pick a date" />
454454
<DateTimePicker label="DateTime Picker 12-hour clock" showSeconds={true} onChange={(value) => console.log("DateTimePicker value:", value)} />
455455
<DateTimePicker label="DateTime Picker 24-hour clock" showSeconds={true} timeConvention={TimeConvention.Hours24} onChange={(value) => console.log("DateTimePicker value:", value)} />
456456
<DateTimePicker label="DateTime Picker no seconds" value={new Date()} onChange={(value) => console.log("DateTimePicker value:", value)} />

0 commit comments

Comments
 (0)