Two years on, I am seeing the same behaviour, and the same code (though
elsewhere at
https://github.com/django/django/blob/master/django/forms/widgets.py#L945).
Any updates on how to approach this without reimplementing anything that
gets in the way?
On Tuesday, February 4, 2014 at 2:43:09 AM UTC+1, Fernando Macedo wrote:
>
> In-line editing of DateTimeField updates year's part to current year
>
> Model field:
> publish_date = models.DateTimeField(_("Published from"), blank=True)
>
> Template:
> {% editable f.publish_date
> %}{{f.publish_date|date:"SHORT_DATE_FORMAT"}}{%endeditable%}
>
> On Admin, set the date to a previous year, says 2013. Using in-line
> editing, when I edit the form shows Year's part on Select as the current
> year, with options from 2014 to 2023 (without 2013 option). If saved, the
> original value is lost.
>
> I found that code in Django creates a range of years starting from
> now().year:
> https://github.com/django/django/blob/master/django/forms/extras/widgets.py#L64
>
> Is this an issue from a Mezzanine perspective? How the best aproach to
> solve this? We can modify Mezzanine to init SelectDateWidget with a list
> of years including the instance year as an option?
>
> Thanks,
> Fernando Macedo
>
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.