Skip to content

Latest commit

 

History

History
75 lines (41 loc) · 2.92 KB

design-patterns-controls-DateTimeRangePicker.md

File metadata and controls

75 lines (41 loc) · 2.92 KB

DateTimeRangePicker

Basics

The DateTimeRangePicker control provides an easy way select a date/time range, e.g. Start: 6/5/2017 00:00:00 AM, End: 7/9/2018 00:00:00 AM

When to use

There are a set of date, time and duration pickers available in the SDK. Choose the one that is most suitable to your need.

  • DatePicker - gets a specific date including month, day and year
  • DateTimePicker - gets a specific date including month, day, year and time including hours, minutes, seconds
  • DateTimeRangePicker - gets a range of time between two date and times
  • DayPicker - gets a day of the month
  • DurationPicker - gets a duration in terms of days, hours, minutes and seconds
  • TimePicker - gets a time including hours, minutes, seconds

Best practices

Use the DateTimeRangePicker when the user must enter a date and time range.

Do

  • Use the control as a single entity.
  • Set the default date to the current date unless a specific date is required for context (e.g. the date of the conference).
  • The control is designed to resize relative to available screen width. Allow it to render in either wide or narrow as appropriate.
  • When the control is engaged, the DatePicker renders as a flyout and has defined widths (300px -narrow and 440px – wide). Plan your UI implementation accordingly.
  • The control renders date in a specific format. If allowing for manual entry of date, provide helper text in the appropriate format.

Don't

  • Don't attempt to break apart year from month/day selectors. If granularity is required, use the Dropdown control or something similar.
  • Don't attempt to force resize the control in any way.
  • Don't force the control to render one mode vs. the other (year or month/day)
  • The flyout selector is a light dismiss control. Don't modify this behavior in any way.

Developer tips and tricks

Interactive control and sample source code

Go to the playground site to use the latest control and get source code for your project. Learn more about playground.

Related info