elm-date-format
elm-date-format copied to clipboard
Add non-zero padded month of year
In the format directives there is one missing: a space-padded (or non-padded) month number (July
-> 7
or 7
). I'd find that useful :)
First, space-padding and no padding are different. Second, is there prior art with format strings for what escape sequence should represent one of those?
Prior art:
- http://www.cplusplus.com/reference/ctime/strftime/
- http://php.net/manual/en/function.strftime.php These don't have space-padded or non-padded month numbers.
But there's Ruby:
- https://apidock.com/ruby/DateTime/strftime
which allows for
%-m
.
- don't pad a numerical output.
_ use spaces for padding.
0 use zeros for padding.
^ upcase the result string.
# change case.
: use colons for %z.
I understand there's a difference in space padding and no padding, but in HTML context that usually doesn't matter (unless you do white-space: pre
or something similar). I'm OK with any of the two options, but would probably use non-padded more often.