Skip to content

Commit

Permalink
Truncate milliseconds, UTC marker in Newest Items
Browse files Browse the repository at this point in the history
  • Loading branch information
qsantos committed Sep 5, 2024
1 parent 96e254a commit 9572b95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.1.24

- Truncate milliseconds and UTC marker from times in Newest Items following format change in Hacker News: `2024-09-03 19:06:26.000000Z``2024-09-03 19:06:26`

# v0.1.23

- Fix navigating to parent on user's comments just moves upwards #48
Expand Down
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ chrome.storage.sync.get((options) => {
parts.push("<ul>");
let lastDay = null;
for (const [datetime, index] of datedIndexes) {
const [day, time] = datetime.split("T");
// for format provided by Hacker News is "2024-09-03T19:06:26.000000Z"
const [day, rest] = datetime.split("T");
const [time, fraction] = rest.split(".");
if (day === lastDay) {
parts.push(
`<li data-index="${index}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${time}</li>`,
Expand Down

0 comments on commit 9572b95

Please sign in to comment.