').html(utils.formatDate(dateDay))).append($changesList);
+ const dayEl = $('').append($('').text(dateDay)).append($changesList);
for (const change of dayChanges) {
- const formattedTime = utils.formatTime(utils.parseDate(change.date));
+ const formattedTime = change.date.substr(11, 5);
let $noteLink;
@@ -82,7 +82,12 @@ export async function showDialog(ancestorNoteId) {
}
$changesList.append($('')
- .append(formattedTime + ' - ')
+ .append(
+ $("")
+ .text(formattedTime)
+ .attr("title", change.date)
+ )
+ .append(' - ')
.append($noteLink));
}
@@ -92,23 +97,9 @@ export async function showDialog(ancestorNoteId) {
function groupByDate(result) {
const groupedByDate = new Map();
- const dayCache = {};
for (const row of result) {
- let dateDay = utils.parseDate(row.date);
- dateDay.setHours(0);
- dateDay.setMinutes(0);
- dateDay.setSeconds(0);
- dateDay.setMilliseconds(0);
-
- // this stupidity is to make sure that we always use the same day object because Map uses only
- // reference equality
- if (dayCache[dateDay]) {
- dateDay = dayCache[dateDay];
- }
- else {
- dayCache[dateDay] = dateDay;
- }
+ const dateDay = row.date.substr(0, 10);
if (!groupedByDate.has(dateDay)) {
groupedByDate.set(dateDay, []);
diff --git a/src/routes/api/recent_changes.js b/src/routes/api/recent_changes.js
index 44a4d1d6d..a4049072a 100644
--- a/src/routes/api/recent_changes.js
+++ b/src/routes/api/recent_changes.js
@@ -13,17 +13,17 @@ async function getRecentChanges(req) {
SELECT * FROM (
SELECT note_revisions.noteId,
note_revisions.noteRevisionId,
- note_revisions.utcDateCreated AS date
+ note_revisions.dateLastEdited AS date
FROM note_revisions
- ORDER BY note_revisions.utcDateCreated DESC
+ ORDER BY note_revisions.dateLastEdited DESC
)
UNION ALL SELECT * FROM (
SELECT
notes.noteId,
NULL AS noteRevisionId,
- utcDateModified AS date
+ dateModified AS date
FROM notes
- ORDER BY utcDateModified DESC
+ ORDER BY dateModified DESC
)
ORDER BY date DESC`);
@@ -44,7 +44,7 @@ async function getRecentChanges(req) {
notes.title AS current_title,
notes.isProtected AS current_isProtected,
note_revisions.title,
- note_revisions.utcDateCreated AS date
+ note_revisions.dateCreated AS date
FROM
note_revisions
JOIN notes USING(noteId)
@@ -60,7 +60,7 @@ async function getRecentChanges(req) {
notes.title AS current_title,
notes.isProtected AS current_isProtected,
notes.title,
- notes.utcDateModified AS date
+ notes.dateModified AS date
FROM
notes
WHERE noteId = ?`, [noteRow.noteId]));