Fritzbox2000 opened a new issue, #17063:
URL: https://github.com/apache/echarts/issues/17063

   ### Version
   
   5.3.2
   
   ### Link to Minimal Reproduction
   
   https://codesandbox.io/s/yy-date-error-rqmsup
   
   ### Steps to Reproduce
   
   Use echarts.date.format with a format string containing {yy} on a date with 
a single digit year (2000 to 2009)
   `echarts.time.format(
     "2003-05-04 10:56:30",
     "Echarts output: {yy} "
   );`
   
   ### Current Behavior
   
   Returns a string with no padding 
   
   ### Expected Behavior
   
   According to 
https://echarts.apache.org/en/option.html#timeline.label.formatter: 
   {yy} -> 00-99 
   this implies that the number should be padded to be size 2 e.g. 2000 goes to 
00, 2003 goes to 03
   
   ### Environment
   
   _No response_
   
   ### Any additional comments?
   
   A current fix could be changing 
   
https://github.com/apache/echarts/blob/13c2d062e6bcd49ab6da87eb4032ac01ec9fe467/src/util/time.ts#L136
   (`        .replace(/{yy}/g, y % 100 + '')`)
   to:
   `        .replace(/{yy}/g, pad( y % 100 + ''),2)`


-- 
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: commits-unsubscr...@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to