WIP: Rework timeStuffs to allow time formats to be specified #517
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was wanting to be able to format dates differently from the default american style. After having a look into the code, I decided to:
genTimeStuffs()
to allow formats to be passed as an opts objectIt allows users to give the time component formats in a
timeFormat
object. For example, to use DD/MM/YYYY.To use YYYY-MM-DD
If not specified in
timeFormats
the original defaults will be used.This is a bit more basic than the request in #474, but it is a start for allowing different formats (I currently don't have time to dig into the Intl date format stuff atm).
One thing I was wondering about was also allow you to specify the months and days in the
timeFormat
object. In the example case of Russian names, this could mean you don't need to calluPlot.fmtDate
and just give it the arrays in thetimeFormat
object