[Zope-dev] zope.i18n/z3c.form: Date localizing problems

Hermann Himmelbauer dusty at qwer.tk
Tue Sep 23 09:30:06 EDT 2008


Hi,
I'm currently implementing a simple date widget/field (birth date) in my 
z3c.form - based form. My two main languages are Englisch and German.

In German, I'd like to write the date such as dd.mm.yyyy
And in English, something suitable would be something like mm/dd/yyyy.

However, that does not seem to be possible. By default, the german format 
is "short", which is "dd.mm.yy" (inappropriate for a birth date). If I 
override the format to "medium" with something like this:

-----------------
class BSPDateDataConverter(DateDataConverter):
    """Better representation"""
    length = 'medium'
------------------
  <adapter
      factory="zbsp.main.BSPDateDataConverter"
      />
----------------

then the german date is fine, but the "medium" english date is in a format 
such as "MMM d, yyyy", which is e.g. "Sep 21, 1980". This is probably a date 
format nobody will be able to enter, I assume?

Is there a way to make this work for both languages?

Best Regards,
Hermann

-- 
hermann at qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7


More information about the Zope-Dev mailing list