mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 12:48:57 +03:00
Need more datetime detail for Edit History
This commit is contained in:
parent
7b8c7f3fb6
commit
d86a69903f
2 changed files with 10 additions and 2 deletions
|
@ -1295,7 +1295,14 @@ function EditedAtModal({
|
|||
return (
|
||||
<li key={createdAt} class="history-item">
|
||||
<h3>
|
||||
<time>{niceDateTime(createdAtDate)}</time>
|
||||
<time>
|
||||
{niceDateTime(createdAtDate, {
|
||||
formatOpts: {
|
||||
weekday: 'short',
|
||||
second: 'numeric',
|
||||
},
|
||||
})}
|
||||
</time>
|
||||
</h3>
|
||||
<Status
|
||||
status={status}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function niceDateTime(date, { hideTime } = {}) {
|
||||
function niceDateTime(date, { hideTime, formatOpts } = {}) {
|
||||
if (!(date instanceof Date)) {
|
||||
date = new Date(date);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ function niceDateTime(date, { hideTime } = {}) {
|
|||
// Hide time if requested
|
||||
hour: hideTime ? undefined : 'numeric',
|
||||
minute: hideTime ? undefined : 'numeric',
|
||||
...formatOpts,
|
||||
}).format(date);
|
||||
return dateText;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue