mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

Month in candidate birth dates undeclined #817

Closed wfdd closed 8 years ago

wfdd commented 8 years ago

In most European languages that are not English, when specifying a date, the month is given in the genitive case. To quote Unicode:

Month, day, and quarter names may vary along two axes: the width and the context.

The context is either format (the default), the form used within a complete date format string (such as "Saturday, November 12", or stand-alone, the form for date elements used independently, such as in calendar headers. The most important distinction between format and stand-alone forms is a grammatical distinction, for languages that require it. For example, many languages require that a month name without an associated day number (i.e. an independent form) be in the basic nominative form, while a month name with an associated day number (as in a complete date format) should be in a different grammatical form: genitive, partitive, etc. ...

This seems impossible to do with Django's date filter, which replicates the PHP date function, but can be done with PyICU or Babel or anything that might interface with the Unicode CLDR.

dracos commented 8 years ago

It's not impossible with date, there is an "E" instead of "F" option, which appears to use the genitive (at least for Greek) – for January, it outputs Ιανουαρίου rather than Ιανουάριος.

Alternatively, just use numbers ;)

wfdd commented 8 years ago

ah, I missed that. Thanks @dracos.