This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch fix/workflow/update-notice-year
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 60cbc9fe3c34cfc23de82a587032a820968bfa9c
Author: plainheart <y...@all-my-life.cn>
AuthorDate: Mon Jan 1 00:20:14 2024 +0800

    chore(workflow): fix timezone error when getting new year by `new Date`
---
 .github/workflows/.scripts/update-notice-year.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/.scripts/update-notice-year.js 
b/.github/workflows/.scripts/update-notice-year.js
index 61505ff5a..2fbb6b7b8 100644
--- a/.github/workflows/.scripts/update-notice-year.js
+++ b/.github/workflows/.scripts/update-notice-year.js
@@ -7,7 +7,10 @@ module.exports = async function updateNoticeYear(
   /** @type {{ octokit: Octokit, context: Context }} */
   { octokit, context }
 ) {
-  const newYear = new Date().getFullYear()
+  const now = new Date()
+  // Change to UTC+8
+  now.setHours(now.getHours() + 8)
+  const newYear = now.getFullYear()
   console.log('Prepare to update notice year to', newYear)
 
   const noticeContent = `Apache ECharts


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to