From 66844b055e686814635ab67b8aee4c0b35550acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Summer=E2=9B=B1?= <57806936+honue@users.noreply.github.com> Date: Mon, 1 Jan 2024 22:36:49 +0800 Subject: [PATCH] fix(route): douban recommended two-digit month (#14153) --- lib/v2/douban/other/recommended.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/v2/douban/other/recommended.js b/lib/v2/douban/other/recommended.js index 7d0397de3..e8ef689ac 100644 --- a/lib/v2/douban/other/recommended.js +++ b/lib/v2/douban/other/recommended.js @@ -18,7 +18,9 @@ module.exports = async (ctx) => { const date = new Date(); const year = date.getFullYear(); - const mon = date.getMonth() + 1; + const month = date.getMonth() + 1; + const mon = month < 10 ? '0' + month : month.toString(); + let items = response.data.data[0].items; const subjectCollectionId = items.find((item) => item.title.startsWith(`${year}年${mon}月`)).id;