Add support for datetime fields (date and time in same field) #637
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've added support for datetime fields, since I needed it in a project.
Initialising is done in one of the following ways:
Default
This will initialise the datetime field, adhering to the current default date and time formats and the default delimiters
['d', 'm', 'Y']
and['h', 'm', 's']
. Which means that the format will bedd/mm/yyyy hh:mm:ss
(31/12/1990 23:59:59).Custom patterns
One or both of the patterns can be customized like this:
Which will initialise with the format
mm/dd hh:mm
(12/31 23:59)Custom delimiters
At the same time, the delimiters can be overriden like this:
Which will initialise with the format
dd-mm-yyyy at hh.mm.ss
(31-12-2020 at 23.59.59)Custom patterns and delimiters
Both patterns and delimiters can be customized at the same time, eg.:
Which will initialise with the format
mm-dd at hh.mm
(12-31 at 23:59)