mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
89f9516f04
refs https://github.com/TryGhost/Team/issues/1390 - added `membersTimeFilters` feature flag and labs toggle - added `<GhDatePicker>` component that lifts functionality from the `<GhDateTimePicker>` component - `<GhDateTimePicker>` has not yet been refactored to use the new component internally as there are some odd/complex interactions with error handling with it's existing use-cases and they are in critical publishing paths so the refactor doesn't belong as part of this change - added "Created at" filter type to members filters - uses new date picker component for input value - has "before", "on or before", "after", "on or after" operators - "on" and "not on" operators were skipped as they require two NQL statements to represent, breaking the current 1:1 statement:filter approach used in the NQL-based query param parsing
39 lines
1.5 KiB
Handlebars
39 lines
1.5 KiB
Handlebars
|
|
<div class="gh-date-picker">
|
|
<PowerDatepicker
|
|
@selected={{@value}}
|
|
@center={{@value}}
|
|
@onSelect={{this.onDateSelected}}
|
|
@renderInPlace={{true}}
|
|
@disabled={{@disabled}}
|
|
as |dp|
|
|
>
|
|
<dp.Trigger @tabindex="-1" data-test-date-picker-trigger ...attributes>
|
|
<div class="{{if this.error "error"}}">
|
|
{{!-- template-lint-disable no-down-event-binding --}}
|
|
<input
|
|
type="text"
|
|
placeholder={{this.dateFormat}}
|
|
value={{moment-format @value this.dateFormat}}
|
|
disabled={{@disabled}}
|
|
aria-label="Selected date"
|
|
class="gh-input gh-datepicker-input"
|
|
{{on "input" (fn this.onDateInput dp)}}
|
|
{{on "blur" this.onDateBlur}}
|
|
{{on "keydown" (fn this.onDateKeydown dp)}}
|
|
{{did-update this.resetInputValue @value}}
|
|
data-test-date-picker-input
|
|
/>
|
|
{{svg-jar "calendar" class="gh-date-picker-cal-icon"}}
|
|
</div>
|
|
</dp.Trigger>
|
|
<dp.Content class="dropdown-menu">
|
|
<dp.Nav />
|
|
<dp.Days @minDate={{this.minDate}} @maxDate={{this.maxDate}} @weekdayFormat="min" />
|
|
</dp.Content>
|
|
</PowerDatepicker>
|
|
|
|
{{#if this.error}}
|
|
<div class="gh-date-time-picker-error" data-test-date-picker-error>{{this.error}}</div>
|
|
{{/if}}
|
|
</div> |