Hi, not sure if this has been discussed, but i couldn't find any thread. My header is wrong, i'm talking about datetimeparser, not formatter!
I have a need for a custom, locale specific dateformatter/parser. For most fields i want to display my datetime fields as "yyyy-MM-dd HH:mm".
For this purpose i set dateutil.setdateformatter with a custom class, and a parser to parse it back into dates.
for this i'm using
However, my issue is that if i have an item, for example date field or datechooser which is date and not datetime, that formatter is still called, then with the string "yyyy-MM-dd" but without the time part -> i get an IllegalArgumentException.
What i imagine is needed here is dateutil.setdatetimeparser in addition to setdateparser, but there is no such method.
Is there another way to accomplish what i need i.e. one parser for date and another one for datetime ?
Thanks for input.
I have a need for a custom, locale specific dateformatter/parser. For most fields i want to display my datetime fields as "yyyy-MM-dd HH:mm".
For this purpose i set dateutil.setdateformatter with a custom class, and a parser to parse it back into dates.
for this i'm using
Code:
Dateutil.setdateformatter and dateutil.setdateparser
What i imagine is needed here is dateutil.setdatetimeparser in addition to setdateparser, but there is no such method.
Is there another way to accomplish what i need i.e. one parser for date and another one for datetime ?
Thanks for input.
Comment