#11231: forms.DateField, initial doesn't print out in input_formats format
---------------------------+------------------------------------------------
 Reporter:  skm            |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 start_date = forms.DateField(initial=date.today()-timedelta(days=1),
 input_formats=[DATE_FORMAT],
 widget=forms.TextInput(attrs={"readonly":"true"}))

 I can use strftime() but then in view code, where I am adding timedelta,
 accessing SearchForm.base_fields["start_date"].initial doesnt return a
 datetime object, it returns a string

 As well as that, if the value isn't there the format ends up being
 different to when someone selects a date.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11231>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to