Merge branch 'change-date-format' into 'develop'
Change date format globally to use 12-hr format See merge request soapbox-pub/soapbox!1836
This commit is contained in:
commit
7fe24ea46a
|
@ -34,22 +34,23 @@ const Announcement: React.FC<IAnnouncement> = ({ announcement, addReaction, remo
|
||||||
<Text theme='muted'>
|
<Text theme='muted'>
|
||||||
<FormattedDate
|
<FormattedDate
|
||||||
value={startsAt}
|
value={startsAt}
|
||||||
hour12={false}
|
hour12
|
||||||
year={(skipYear || startsAt.getFullYear() === now.getFullYear()) ? undefined : 'numeric'}
|
year={(skipYear || startsAt.getFullYear() === now.getFullYear()) ? undefined : 'numeric'}
|
||||||
month='short'
|
month='short'
|
||||||
day='2-digit'
|
day='2-digit'
|
||||||
hour={skipTime ? undefined : '2-digit'} minute={skipTime ? undefined : '2-digit'}
|
hour={skipTime ? undefined : 'numeric'}
|
||||||
|
minute={skipTime ? undefined : '2-digit'}
|
||||||
/>
|
/>
|
||||||
{' '}
|
{' '}
|
||||||
-
|
-
|
||||||
{' '}
|
{' '}
|
||||||
<FormattedDate
|
<FormattedDate
|
||||||
value={endsAt}
|
value={endsAt}
|
||||||
hour12={false}
|
hour12
|
||||||
year={(skipYear || endsAt.getFullYear() === now.getFullYear()) ? undefined : 'numeric'}
|
year={(skipYear || endsAt.getFullYear() === now.getFullYear()) ? undefined : 'numeric'}
|
||||||
month={skipEndDate ? undefined : 'short'}
|
month={skipEndDate ? undefined : 'short'}
|
||||||
day={skipEndDate ? undefined : '2-digit'}
|
day={skipEndDate ? undefined : '2-digit'}
|
||||||
hour={skipTime ? undefined : '2-digit'}
|
hour={skipTime ? undefined : 'numeric'}
|
||||||
minute={skipTime ? undefined : '2-digit'}
|
minute={skipTime ? undefined : '2-digit'}
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
|
@ -17,11 +17,11 @@ const messages = defineMessages({
|
||||||
});
|
});
|
||||||
|
|
||||||
const dateFormatOptions: FormatDateOptions = {
|
const dateFormatOptions: FormatDateOptions = {
|
||||||
hour12: false,
|
hour12: true,
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'short',
|
month: 'short',
|
||||||
day: '2-digit',
|
day: '2-digit',
|
||||||
hour: '2-digit',
|
hour: 'numeric',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,11 @@ const ModerationLog = () => {
|
||||||
<div className='logentry__timestamp'>
|
<div className='logentry__timestamp'>
|
||||||
<FormattedDate
|
<FormattedDate
|
||||||
value={new Date(item.time * 1000)}
|
value={new Date(item.time * 1000)}
|
||||||
hour12={false}
|
hour12
|
||||||
year='numeric'
|
year='numeric'
|
||||||
month='short'
|
month='short'
|
||||||
day='2-digit'
|
day='2-digit'
|
||||||
hour='2-digit'
|
hour='numeric'
|
||||||
minute='2-digit'
|
minute='2-digit'
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,11 +31,11 @@ const AuthToken: React.FC<IAuthToken> = ({ token }) => {
|
||||||
<Text size='sm' theme='muted'>
|
<Text size='sm' theme='muted'>
|
||||||
<FormattedDate
|
<FormattedDate
|
||||||
value={new Date(token.valid_until)}
|
value={new Date(token.valid_until)}
|
||||||
hour12={false}
|
hour12
|
||||||
year='numeric'
|
year='numeric'
|
||||||
month='short'
|
month='short'
|
||||||
day='2-digit'
|
day='2-digit'
|
||||||
hour='2-digit'
|
hour='numeric'
|
||||||
minute='2-digit'
|
minute='2-digit'
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
|
@ -108,7 +108,7 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
|
||||||
<span>
|
<span>
|
||||||
<a href={actualStatus.url} target='_blank' rel='noopener' className='hover:underline'>
|
<a href={actualStatus.url} target='_blank' rel='noopener' className='hover:underline'>
|
||||||
<Text tag='span' theme='muted' size='sm'>
|
<Text tag='span' theme='muted' size='sm'>
|
||||||
<FormattedDate value={new Date(actualStatus.created_at)} hour12={false} year='numeric' month='short' day='2-digit' hour='2-digit' minute='2-digit' />
|
<FormattedDate value={new Date(actualStatus.created_at)} hour12 year='numeric' month='short' day='2-digit' hour='numeric' minute='2-digit' />
|
||||||
</Text>
|
</Text>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<Text tag='span' theme='muted' size='sm'>
|
<Text tag='span' theme='muted' size='sm'>
|
||||||
<FormattedMessage id='actualStatus.edited' defaultMessage='Edited {date}' values={{ date: intl.formatDate(new Date(actualStatus.edited_at), { hour12: false, month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }) }} />
|
<FormattedMessage id='actualStatus.edited' defaultMessage='Edited {date}' values={{ date: intl.formatDate(new Date(actualStatus.edited_at), { hour12: true, month: 'short', day: '2-digit', hour: 'numeric', minute: '2-digit' }) }} />
|
||||||
</Text>
|
</Text>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -79,7 +79,7 @@ const CompareHistoryModal: React.FC<ICompareHistoryModal> = ({ onClose, statusId
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Text align='right' tag='span' theme='muted' size='sm'>
|
<Text align='right' tag='span' theme='muted' size='sm'>
|
||||||
<FormattedDate value={new Date(version.created_at)} hour12={false} year='numeric' month='short' day='2-digit' hour='2-digit' minute='2-digit' />
|
<FormattedDate value={new Date(version.created_at)} hour12 year='numeric' month='short' day='2-digit' hour='numeric' minute='2-digit' />
|
||||||
</Text>
|
</Text>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -22,8 +22,8 @@ const dateFormatOptions: FormatDateOptions = {
|
||||||
month: 'short',
|
month: 'short',
|
||||||
day: 'numeric',
|
day: 'numeric',
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
hour12: false,
|
hour12: true,
|
||||||
hour: '2-digit',
|
hour: 'numeric',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue