Benjamin Liu
6af4db2ab5
fix(xueqiu/kline,earnings-date): format dates in Asia/Shanghai instead of UTC ( #1498 )
...
* fix(xueqiu/kline,earnings-date): format dates in Asia/Shanghai instead of UTC (#1465 )
`xueqiu/kline` and `xueqiu/earnings-date` formatted bar timestamps with
`new Date(ts).toISOString().split('T')[0]`. That string is the UTC
calendar date, always one day earlier than the date xueqiu shows in its
UI (which is Beijing-aligned for every market). Issue #1465 reports
"5月10日跑的,5月8号的k线没有" because the May 8 China trading-day bar
was labeled 2026-05-07. Same off-by-one was present in `earnings-date.js`.
Routes both call sites through a new `formatChinaDate(ts)` helper in
`clis/xueqiu/utils.js` built on `toLocaleDateString('en-CA', { timeZone:
'Asia/Shanghai' })`. Verified live against SZ300136 and AAPL: both now
match the dates shown on xueqiu.com.
Tests: `clis/xueqiu/utils.test.js` (new) pins the Asia/Shanghai semantic
with 4 cases (China midnight, late-evening, 16:00 UTC day boundary, and
nullish input). `npx vitest run --project adapter clis/xueqiu/` 49/49,
`npx tsc --noEmit` clean, `npm run build` 815 entries unchanged shape.
Closes #1465
* fix(xueqiu): stabilize China date formatting
---------
Co-authored-by: jackwener <jakevingoo@gmail.com >
2026-05-13 17:40:28 +08:00
..
2026-05-07 22:02:12 +08:00
2026-05-05 18:00:33 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 21:22:23 +08:00
2026-05-06 02:14:12 +08:00
2026-05-05 01:39:22 +08:00
2026-05-06 23:30:03 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 02:24:16 +08:00
2026-05-06 23:49:39 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 12:46:14 +08:00
2026-05-08 01:55:19 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 20:54:14 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 23:30:03 +08:00
2026-05-11 17:52:16 +08:00
2026-05-06 23:30:03 +08:00
2026-05-06 23:30:03 +08:00
2026-05-11 04:56:34 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 23:30:03 +08:00
2026-05-06 13:14:41 +08:00
2026-05-07 00:18:57 +08:00
2026-05-06 13:14:41 +08:00
2026-05-12 03:43:32 +08:00
2026-05-06 23:30:03 +08:00
2026-05-06 13:14:41 +08:00
2026-05-11 04:56:34 +08:00
2026-05-06 14:19:55 +08:00
2026-05-06 12:46:14 +08:00
2026-05-10 14:57:44 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 13:38:43 +08:00
2026-05-04 21:22:23 +08:00
2026-05-12 02:46:53 +08:00
2026-05-04 19:47:08 +08:00
2026-05-10 14:53:55 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 14:19:55 +08:00
2026-05-07 17:49:57 +08:00
2026-05-06 16:54:21 +08:00
2026-05-11 04:56:34 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 23:49:39 +08:00
2026-05-06 14:19:55 +08:00
2026-05-06 23:49:39 +08:00
2026-05-07 12:46:13 +08:00
2026-05-11 04:56:34 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 13:14:41 +08:00
2026-05-06 13:38:43 +08:00
2026-05-07 16:59:17 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 20:52:16 +08:00
2026-05-06 23:30:03 +08:00
2026-05-05 01:39:22 +08:00
2026-05-04 19:47:08 +08:00
2026-05-08 01:55:19 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 16:54:21 +08:00
2026-05-11 01:06:48 +08:00
2026-05-06 23:57:15 +08:00
2026-05-06 12:46:14 +08:00
2026-05-11 01:06:48 +08:00
2026-05-06 13:38:43 +08:00
2026-05-06 13:14:41 +08:00
2026-05-06 12:46:14 +08:00
2026-05-04 19:47:08 +08:00
2026-05-11 04:26:51 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 13:14:41 +08:00
2026-05-06 16:54:21 +08:00
2026-05-06 13:14:41 +08:00
2026-05-06 16:54:21 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 13:38:43 +08:00
2026-05-06 17:47:05 +08:00
2026-05-11 01:53:46 +08:00
2026-05-06 14:19:55 +08:00
2026-05-06 13:38:43 +08:00
2026-05-06 23:30:03 +08:00
2026-05-05 01:39:22 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 01:54:29 +08:00
2026-05-06 13:14:41 +08:00
2026-05-06 23:30:03 +08:00
2026-05-11 04:56:34 +08:00
2026-05-12 04:10:44 +08:00
2026-05-12 02:59:15 +08:00
2026-05-06 16:54:21 +08:00
2026-05-06 20:00:36 +08:00
2026-05-06 14:19:55 +08:00
2026-05-06 13:38:43 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-04-10 14:52:18 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 13:14:41 +08:00
2026-05-06 12:46:14 +08:00
2026-05-04 19:47:08 +08:00
2026-05-05 01:39:22 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 23:49:39 +08:00
2026-05-07 16:33:00 +08:00
2026-05-06 23:17:32 +08:00
2026-05-06 14:19:55 +08:00
2026-05-12 21:48:44 +08:00
2026-05-06 02:14:12 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 23:49:39 +08:00
2026-05-07 01:15:10 +08:00
2026-05-04 20:54:14 +08:00
2026-05-06 23:30:03 +08:00
2026-05-04 19:47:08 +08:00
2026-05-06 16:54:21 +08:00
2026-05-06 02:24:16 +08:00
2026-05-06 17:47:05 +08:00
2026-05-05 23:35:23 +08:00
2026-05-07 17:02:23 +08:00
2026-05-12 02:59:15 +08:00
2026-05-04 19:47:08 +08:00
2026-05-13 17:40:28 +08:00
2026-05-04 19:47:08 +08:00
2026-05-04 19:47:08 +08:00
2026-05-12 02:44:21 +08:00
2026-05-11 04:56:34 +08:00
2026-05-04 19:47:08 +08:00
2026-05-05 01:39:22 +08:00
2026-05-04 19:47:08 +08:00
2026-05-05 01:39:22 +08:00