﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28544	"unlocalize template filter not consistent with ""localize off"" for datetimes - does not honor DATETIME_FORMAT"	Beda Kosata	nobody	"Hello,

according to the documentation, using {{{{% localize off %}{{ variable }}{% endlocalize %}}}} should be equivalent to {{{{{ variable|unlocalize }}}}}. However, for datetimes the former formats the variable according to DATETIME_FORMAT setting, while the latter does not and uses some default ISO based formatting.

To make a suggestion, I think that the source for the ulocalize filter should be:

{{{
@register.filter(is_safe=False)
def unlocalize(value):
    """"""
    Forces a value to be rendered as a non-localized value,
    regardless of the value of ``settings.USE_L10N``.
    """"""
    return force_text(formats.localize(value, use_l10n=False))
}}}


instead of


{{{
@register.filter(is_safe=False)
def unlocalize(value):
    """"""
    Forces a value to be rendered as a non-localized value,
    regardless of the value of ``settings.USE_L10N``.
    """"""
    return force_text(value)
}}}


Best regards

Beda"	Bug	closed	Internationalization	1.11	Normal	fixed	l10n		Ready for checkin	1	0	0	0	0	0
