Re: Can't get date formatting right
On 27/06/2012 11:07, Benedict Verheyen wrote:
<snip>
>>
>
> I found a bug where there was a reference too translation.activate(settings.LANGUAGE_CODE)
> I tried this as the first line of code in the view, and then my date is formatted correcly
> and a date of format dd/mm/yy is accepted.
> Is it necessary to add the translation line or is there another way?
> Also, what if the language changes, will that line still work as it gets the language code
> from the settings, and not the currently active code.
>
> Cheers,
> Benedict
>
I added this to the view to test some more
check_for_language("nl")
activate("nl")
and then the dates are formatted correctly and they accept the input as they should.
By checking LANGUAGE_CODE in my template, I can even make the jquery datepicker do the right thing.
Still, how come that this doesn't work before I activate the language myself?
I specified a DEFAULT_LANGUAGE and LANGUAGE_CODE in my settings, yet it only accepts the
belgian/dutch dates after I activate the language manually.
Isn't the default language as specified in the settings activated by default?
Regards,
Benedict
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home