Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
There is no single-digit formatter for month #8150
I can format a date like (4/3) for April 3rd without requiring a custom formatter.
The default formats April 3rd like (04/3), which looks very weird. I can double-digit pad the day to make it look like (04/03), but that still looks bad.
Live demo with steps to reproduce
We don't have to use formatter, we can keep
PS: In my opinion
I agree with @glajchs, we should support this. In some cultures (like my own), it is common to write 10/3 for April 10th and so on. I'm surprised PHP doesn't have a symbol for this.
Do you have any suggestion for which letter to use? Any conventions out there in other programming languages?
But the %j in returns global day from a year, not month.
I have a suggestion for what the new "month # without leading zero" variable should be, which is "%o". Highcharts uses a subset of the PHP API, as linked above. In the PHP API, the standard seems to be to use the next available letter in the alphabet, in lower case, when providing the non-leading-zeros-prefixed version of a value. For instance the leading-zero-prefixed 24 hour value is "%H", and the non-leading-zero-prefixed version of the 24 hour value is "%k". It's not "%h" because that's already taken, and it's not "%i", or "%j" because those are already taken.
Since our 2 digit month is "%m", and "%M" is already taken, the next value could be "%n", but I'd advise against that since you're borrowing a subset from the PHP API, and in the PHP API "%n" is newline char (even though highcharts doesn't support this).