Skip to content

Commit

Permalink
fix(v2): use tag time for showing last update of doc item (#1981)
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored and yangshun committed Nov 13, 2019
1 parent 0f30077 commit 37ec85b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/docusaurus-theme-classic/src/theme/DocItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,15 @@ function DocItem(props) {
{lastUpdatedAt && (
<>
on{' '}
<strong>
<time
dateTime={new Date(
lastUpdatedAt * 1000,
).toISOString()}
className={styles.docLastUpdatedAt}>
{new Date(
lastUpdatedAt * 1000,
).toLocaleDateString()}
</strong>
</time>
{lastUpdatedBy && ' '}
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@
padding: 0 0.3rem;
}
}

.docLastUpdatedAt {
font-weight: bold;
}

0 comments on commit 37ec85b

Please sign in to comment.