Ghost/ghost/admin/app/templates/components/gh-date-time-picker.hbs
Paul Perkins a4e18e9bfe 🎨 Changed post/page date picker format to 'YYYY-MM-DD' (#1213)
refs https://github.com/TryGhost/Ghost/issues/10767

The use of the date format 'MM/DD/YYYY' is confusing to those not in American English locations. In the absence of being able to dynamically determine full locale data, using 'YYYY-MM-DD' seems to the least ambiguous date format which would be intuitive to most users.
2019-06-24 09:06:39 +01:00

36 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 "YYYY-MM-DD"}} disabled={{disabled}} data-test-date-time-picker-date-input>
{{svg-jar "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"}}">
<input
type="text"
value={{_time}}
disabled={{disabled}}
oninput={{action (mut _time) value="target.value"}}
onblur={{action "setTime" _time}}
data-test-date-time-picker-time-input
>
<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}}