mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
aa5b85d7c1
closes https://github.com/TryGhost/Ghost/issues/8891 - set the `center` option as well as the `selected` option for `{{power-datepicker}}` inside `{{gh-date-time-picker}}` to force the month view to jump to the correct date when the selection changes
33 lines
1.3 KiB
Handlebars
33 lines
1.3 KiB
Handlebars
<div class="gh-date-time-picker">
|
|
{{#power-datepicker
|
|
selected=_date
|
|
center=_date
|
|
onSelect=(action "setDate" value="date")
|
|
renderInPlace=true
|
|
disabled=disabled as |dp|
|
|
}}
|
|
{{#dp.trigger tabindex="-1" data-test-date-time-picker-datepicker=true}}
|
|
<div class="gh-date-time-picker-date {{if dateError "error"}}">
|
|
<input type="text" readonly value={{moment-format _date "MM/DD/YYYY"}} disabled={{disabled}} data-test-date-time-picker-date-input>
|
|
{{inline-svg "calendar"}}
|
|
</div>
|
|
{{/dp.trigger}}
|
|
{{#dp.content class="dropdown-menu"}}
|
|
{{dp.nav}}
|
|
{{dp.days minDate=_minDate maxDate=_maxDate weekdayFormat="min"}}
|
|
{{/dp.content}}
|
|
{{/power-datepicker}}
|
|
|
|
<div class="gh-date-time-picker-time {{if hasError "error"}}">
|
|
{{one-way-input _time
|
|
update=(action (mut _time))
|
|
focusOut=(action "setTime" _time)
|
|
disabled=disabled
|
|
data-test-date-time-picker-time-input=true}}
|
|
<small class="gh-date-time-picker-timezone">({{timezone}})</small>
|
|
</div>
|
|
</div>
|
|
{{#if hasError}}
|
|
<div class="gh-date-time-picker-error" data-test-date-time-picker-error>{{dateError}}{{timeError}}</div>
|
|
{{/if}}
|