diff --git a/public/css/main.css b/public/css/main.css index fa29670..08e5944 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -19,6 +19,12 @@ h1,h2,h3,h4,h5,h6{ .container-fluid-custom{ max-width: 1600px; } +.card small { + font-size: 0.8rem; + display: block; + margin-top: 10px; + color: #6c757d; +} .btn{ padding-left: 1.6rem; diff --git a/server/controllers/dashboardController.js b/server/controllers/dashboardController.js index f292d4a..f96186c 100644 --- a/server/controllers/dashboardController.js +++ b/server/controllers/dashboardController.js @@ -22,10 +22,12 @@ exports.dashboard = async (req, res) => { { $sort: { updatedAt: -1 } }, { $match: { user: new mongoose.Types.ObjectId(req.user.id) } }, { - $project: { + $project: { title: { $substr: ["$title", 0, 30] }, body: { $substr: ["$body", 0, 100] }, - }, + createdAt: 1, + updatedAt: 1 + } }, ]) .skip(perPage * page - perPage) diff --git a/views/dashboard/index.ejs b/views/dashboard/index.ejs index 2431e4b..a9dac11 100644 --- a/views/dashboard/index.ejs +++ b/views/dashboard/index.ejs @@ -17,6 +17,11 @@
<%= notes[i].title %>

<%= notes[i].body %>

+ + Created: <%= new Date(notes[i].createdAt).toLocaleString() %> +
+ Updated: <%= new Date(notes[i].updatedAt).toLocaleString() %> +