Merge pull request #1050 from zdf1230/timezone

Use local time zone automatically
This commit is contained in:
tangly1024
2023-05-15 17:06:33 +08:00
committed by GitHub

View File

@@ -40,7 +40,7 @@ export async function getPageWithRetry(id, from, retryAttempts = 3) {
console.log('[请求API]', `from:${from}`, `id:${id}`, retryAttempts < 3 ? `剩余重试次数:${retryAttempts}` : '')
try {
const authToken = BLOG.NOTION_ACCESS_TOKEN || null
const api = new NotionAPI({ authToken, userTimeZone: 'Asia/ShangHai' })
const api = new NotionAPI({ authToken, userTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone })
const pageData = await api.getPage(id)
console.info('[响应成功]:', `from:${from}`)
return pageData