Add Ordinal Indicator (st, nd, rd, th) to Day of Month in ECharts Label Formatter

yvfmudvl  于 2个月前  发布在  Echarts
关注(0)|答案(1)|浏览(31)

What problem does this feature solve?

ECharts' time series label formatter can show dates like "1 October 2023" using {d} {MMM} {yyyy} . But it cannot show "1st October 2023" with the "st" after the "1". It needs a new template to do this.

I suggest adding a template that will produce Day of Month with ordinal indicators such as 1st, 2nd, 3rd, 4th, 5th, etc.

What does the proposed API look like?

I propose adding a new template {Do} which stands for "day with ordinal" and produces days of the month with the correct ordinal indicator (st, nd, rd, th) such as 1st, 2nd, 3rd, 4th, 5th, etc.

lmvvr0a8

lmvvr0a81#

I found myself needing this again today. Any chance it could be added?

相关问题