trackoor opened a new issue, #21824: URL: https://github.com/apache/echarts/issues/21824
### Version 6.1.0 (also master 34f4d92) ### Link to Minimal Reproduction Not applicable: the bug needs the page's local time zone to have a DST change at midnight (for example Atlantic/Azores), which an online editor cannot set; the Node script below sets it with `TZ`. ### Steps to Reproduce 1. `npm i [email protected]` 2. Save as `repro.cjs` and run `TZ=Atlantic/Azores node repro.cjs`: ```js // Run with: TZ=Atlantic/Azores node repro.cjs const echarts = require('echarts'); const chart = echarts.init(null, null, {renderer: 'svg', ssr: true, width: 600, height: 300}); chart.setOption({ animation: false, xAxis: {type: 'time'}, yAxis: {type: 'value'}, series: [{type: 'line', data: [[Date.parse('2026-03-26T12:00Z'), 1], [Date.parse('2026-04-03T00:00Z'), 2]]}] }); for (const l of chart.getModel().getComponent('xAxis').axis.getViewLabels()) { console.log(new Date(l.tick.value).toString().slice(0, 24), JSON.stringify(l.formattedLabel)); } chart.dispose(); ``` ### Current Behavior ``` Thu Mar 26 2026 11:00:00 "11:00" Fri Mar 27 2026 00:00:00 "27" Sat Mar 28 2026 00:00:00 "28" Sun Mar 29 2026 01:00:00 "01:00" Mon Mar 30 2026 01:00:00 "01:00" Tue Mar 31 2026 01:00:00 "01:00" Wed Apr 01 2026 00:00:00 "{primary|Apr}" Wed Apr 01 2026 01:00:00 "01:00" Thu Apr 02 2026 00:00:00 "2" Fri Apr 03 2026 00:00:00 "3" ``` On Mar 29 local midnight does not exist (00:00 jumps to 01:00). From that day on every day tick until the end of the month sits at 01:00 and is labeled `"01:00"` instead of the day number, and there is an extra tick at Apr 01 01:00. ### Expected Behavior Day ticks at the start of each local day (01:00 only on Mar 29, where 00:00 does not exist), labeled `"27"`, `"28"`, `"29"`, `"30"`, `"31"`, `"{primary|Apr}"`, `"2"`, `"3"`, and no tick at Apr 01 01:00. ### Environment ```markdown - OS: Debian 12, TZ=Atlantic/Azores - Browser: none (Node.js 26.13.0, SSR) - Framework: none ``` ### Any additional comments? `addTicksInSpan` in `src/scale/Time.ts` steps one `Date` with `date[setMethodName](date[getMethodName]() + interval)`, so after the DST day the wall time stays at 01:00. `createIntervalTicks` then picks each tick's unit with `getUnitFromValue(tick.value, isUTC)`, which checks the hour, so a 01:00 day tick is treated as an hour tick. Computing each tick from the span start (or resetting the time after `setDate`) and taking the unit from the level would fix both. Credit: https://ucsbplse.github.io/ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
