Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Latest commit

 

History

History
53 lines (42 loc) · 905 Bytes

date-picker.md

File metadata and controls

53 lines (42 loc) · 905 Bytes

< Back to Components List

Date picker

polaris-date-picker implements the Polaris Date picker component.

Examples

Default date picker:

{{polaris-date-picker
  month=month
  year=year
  selected=selected
  onChange=(action (mut selected))
  onMonthChange=(action "handleMonthChange")
}}

where handleMonthChange receives both month and year arguments as Numbers:

/**
parent-component.js
*/

month: 1,
year: 2018,
selected: null,

actions: {
  handleMonthChange(month, year) {
    this.setProperties({
      month,
      year
    });
  }
}

Date picker with two months displayed at a time:

{{polaris-date-picker
  month=month
  year=year
  selected=selected
  multiMonth=true
  onChange=(action (mut selected))
  onMonthChange=(action "handleMonthChange")
}}