mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 06:25:51 +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
44 lines
1.8 KiB
Handlebars
44 lines
1.8 KiB
Handlebars
<div class="gh-date-time-picker" data-test-component="gh-date-time-picker">
|
|
<PowerDatepicker
|
|
@selected={{this._date}}
|
|
@center={{this._date}}
|
|
@onSelect={{action "setDateInternal" value="date"}}
|
|
@renderInPlace={{true}}
|
|
@disabled={{this.disabled}} as |dp|
|
|
>
|
|
<dp.Trigger @tabindex="-1" data-test-date-time-picker-datepicker>
|
|
<div class="gh-date-time-picker-date {{if this.dateError "error"}}">
|
|
<input type="text"
|
|
placeholder={{this.dateFormat}}
|
|
value={{readonly this.dateValue}}
|
|
disabled={{this.disabled}}
|
|
{{on "input" (fn this.onDateInput dp)}}
|
|
{{on "blur" this.onDateBlur}}
|
|
{{on "keydown" (fn this.onDateKeydown dp)}}
|
|
data-test-date-time-picker-date-input>
|
|
{{svg-jar "calendar"}}
|
|
</div>
|
|
</dp.Trigger>
|
|
<dp.Content class="dropdown-menu">
|
|
<dp.Nav />
|
|
<dp.Days @minDate={{this._minDate}} @maxDate={{this._maxDate}} @weekdayFormat="min" />
|
|
</dp.Content>
|
|
</PowerDatepicker>
|
|
|
|
<div class="gh-date-time-picker-time {{if this.hasError "error"}}">
|
|
<input
|
|
type="text"
|
|
value={{this._time}}
|
|
disabled={{this.disabled}}
|
|
{{on "change" this.updateTimeValue}}
|
|
{{on "blur" (fn this.setTimeInternal this._time)}}
|
|
{{did-insert this.registerTimeInput}}
|
|
data-test-date-time-picker-time-input
|
|
>
|
|
<small class="gh-date-time-picker-timezone" data-test-date-time-picker-timezone>({{this.timezone}})</small>
|
|
</div>
|
|
</div>
|
|
{{#if this.hasError}}
|
|
<div class="gh-date-time-picker-error" data-test-date-time-picker-error>{{this.dateError}}{{this.timeError}}</div>
|
|
{{/if}}
|