Commit ac4f129d20f4a46f2ba2a0ca11930367b839dc4b

Authored by Zambom
1 parent dea1a8c2

Resolving date internationalization bug

amadeus/settings.py
... ... @@ -139,7 +139,7 @@ TIME_ZONE = 'America/Recife'
139 139  
140 140 USE_I18N = True
141 141  
142   -USE_L10N = False
  142 +USE_L10N = True
143 143  
144 144 USE_TZ = True
145 145  
... ...
forum/templates/forum/forum_form.html
... ... @@ -7,6 +7,9 @@
7 7 <div class="form-group {% if form.has_error %} has-error {% endif %} is-fileinput">
8 8 {% if field.field.widget.input_type == 'hidden' %}
9 9 {% render_field field class='form-control' %}
  10 + {% elif field.auto_id == 'id_limit_date' %}
  11 + <input type="text" class="form-control date-picker"name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" id="{{ field.auto_id }}">
  12 + <span id="helpBlock" class="help-block">{{ field.help_text }}</span>
10 13 {% else %}
11 14 <label for="{{ field.auto_id }}">{{ field.label }}</label>
12 15 {% render_field field %}
... ...
users/forms.py
... ... @@ -72,7 +72,7 @@ class UpdateUserForm(forms.ModelForm):
72 72 fields = ['username', 'name', 'email', 'birth_date', 'city',
73 73 'state', 'gender', 'type_profile', 'cpf', 'phone', 'image', 'titration',
74 74 'year_titration', 'institution', 'curriculum', 'is_staff', 'is_active']
75   -
  75 +
76 76 class UpdateProfileForm(UpdateUserForm):
77 77  
78 78 class Meta:
... ...
users/templates/users/update.html
... ... @@ -34,7 +34,7 @@
34 34 <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
35 35 <label for="{{ field.auto_id }}">{{ field.label }}</label>
36 36 {% if field.auto_id == 'id_birth_date' %}
37   - <input type="text" class="form-control date-picker"name="{{field.name}}" value="{% if field.value.year %}{{field.value|date:'m/d/Y'}}{% else %}{{field.value}}{% endif %}" min="{{now|date:'m/d/Y'}}" id="{{ field.auto_id }}">
  37 + <input type="text" class="form-control date-picker"name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}" id="{{ field.auto_id }}">
38 38 <span id="helpBlock" class="help-block">{{ field.help_text }}</span>
39 39 {% elif field.auto_id == 'id_image' or field.auto_id == 'id_curriculum'%}
40 40 {% render_field field class='form-control input-sm' %}
... ...