Try configuring your form field directly, like this: class CallsForm(ModelForm): contact_date = forms.DateField( localize=True, input_formats=['%m/%d/%Y'], widget=forms.DateInput(attrs={ 'placeholder'='Format is m/d/yyyy...', }) ) class Meta: model = Conversation
This combination of attributes input_formats and localize should make this field to use the m/d/y format for forms (always), while printing the value in the localized way (Aug. 31, 2012). Cheers On Monday, 13 August 2012 14:47:57 UTC+2, Houmie wrote: > > Thanks Melvyn, > > I have tried this: > > def contact_date_callback(self, field, **kwargs) : > return field.contact_date(localize=True, **kwargs) > > But the date still shows as 2012-08-13 > > note, that Aptana Studio 3.0 complained that I put `self` first. > > Nonetheless neither version works. > > Any other idea? :( > > > On 13/08/12 13:20, Melvyn Sopacua wrote: > > def formfield_callback(field, **kwargs) : > > return field.formfield(localize=True, **kwargs) > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/7MlUvieqzRUJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.