import * as React from 'react'; import { DefaultButton } from 'office-ui-fabric-react/lib/Button'; import { DatePicker, DayOfWeek, defaultDayPickerStrings } from '@uifabric/date-time'; import './DatePicker.Examples.scss'; export interface IDatePickerFormatExampleState { firstDayOfWeek?: DayOfWeek; value?: Date | null; } export class DatePickerFormatExample extends React.Component<{}, IDatePickerFormatExampleState> { public constructor(props: {}) { super(props); this.state = { firstDayOfWeek: DayOfWeek.Sunday, value: null, }; } public render(): JSX.Element { const { firstDayOfWeek, value } = this.state; const desc = 'This field is required. One of the support input formats is year dash month dash day.'; return (
Applications can customize how dates are formatted and parsed. Formatted dates can be ambiguous, so the control will avoid parsing the formatted strings of dates selected using the UI when text input is allowed. In this example, we are formatting and parsing dates as dd/MM/yy.