mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-16 23:31:19 +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 (
|
return (
|
||||||
<li key={createdAt} class="history-item">
|
<li key={createdAt} class="history-item">
|
||||||
<h3>
|
<h3>
|
||||||
<time>{niceDateTime(createdAtDate)}</time>
|
<time>
|
||||||
|
{niceDateTime(createdAtDate, {
|
||||||
|
formatOpts: {
|
||||||
|
weekday: 'short',
|
||||||
|
second: 'numeric',
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
</time>
|
||||||
</h3>
|
</h3>
|
||||||
<Status
|
<Status
|
||||||
status={status}
|
status={status}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function niceDateTime(date, { hideTime } = {}) {
|
function niceDateTime(date, { hideTime, formatOpts } = {}) {
|
||||||
if (!(date instanceof Date)) {
|
if (!(date instanceof Date)) {
|
||||||
date = new Date(date);
|
date = new Date(date);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ function niceDateTime(date, { hideTime } = {}) {
|
||||||
// Hide time if requested
|
// Hide time if requested
|
||||||
hour: hideTime ? undefined : 'numeric',
|
hour: hideTime ? undefined : 'numeric',
|
||||||
minute: hideTime ? undefined : 'numeric',
|
minute: hideTime ? undefined : 'numeric',
|
||||||
|
...formatOpts,
|
||||||
}).format(date);
|
}).format(date);
|
||||||
return dateText;
|
return dateText;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue