diff --git a/ui/component/publishReleaseDate/index.js b/ui/component/publishReleaseDate/index.js index e7a1e4fee..9513f4543 100644 --- a/ui/component/publishReleaseDate/index.js +++ b/ui/component/publishReleaseDate/index.js @@ -1,12 +1,15 @@ import { connect } from 'react-redux'; +import * as SETTINGS from 'constants/settings'; import { makeSelectPublishFormValue } from 'redux/selectors/publish'; import { doUpdatePublishForm } from 'redux/actions/publish'; +import { selectClientSetting } from 'redux/selectors/settings'; import PublishReleaseDate from './view'; const select = (state) => ({ releaseTime: makeSelectPublishFormValue('releaseTime')(state), releaseTimeEdited: makeSelectPublishFormValue('releaseTimeEdited')(state), releaseTimeError: makeSelectPublishFormValue('releaseTimeError')(state), + clock24h: selectClientSetting(state, SETTINGS.CLOCK_24H), }); const perform = (dispatch) => ({ diff --git a/ui/component/publishReleaseDate/view.jsx b/ui/component/publishReleaseDate/view.jsx index 8639bcd13..f5147f71c 100644 --- a/ui/component/publishReleaseDate/view.jsx +++ b/ui/component/publishReleaseDate/view.jsx @@ -17,18 +17,21 @@ const RESET_TO_ORIGINAL = 'reset-to-original'; const FUTURE_DATE_ERROR = 'Cannot set to a future date.'; type Props = { - releaseTime: ?number, - releaseTimeEdited: ?number, - updatePublishForm: ({}) => void, allowDefault: ?boolean, showNowBtn: ?boolean, useMaxDate: ?boolean, + // --- redux: + releaseTime: ?number, + releaseTimeEdited: ?number, + clock24h: boolean, + updatePublishForm: ({}) => void, }; const PublishReleaseDate = (props: Props) => { const { releaseTime, releaseTimeEdited, + clock24h, updatePublishForm, allowDefault = true, showNowBtn = true, @@ -155,7 +158,7 @@ const PublishReleaseDate = (props: Props) => { onBlur={handleBlur} onChange={onDateTimePickerChanged} value={date} - format="y-MM-dd h:mm a" + format={clock24h ? 'y-MM-dd HH:mm' : 'y-MM-dd h:mm a'} disableClock clearIcon={null} />