Some date fix

This commit is contained in:
Antoine Bartuccio 2016-12-25 23:36:34 +01:00
parent 772a3b5827
commit cd97901db1
4 changed files with 25 additions and 15 deletions

View File

@ -239,10 +239,10 @@ th {
{% trans %}Polls closed {% endtrans %}
{%- else %}
{% trans %}Polls will open {% endtrans %}
<time datetime="{{ election.start_date }}">{{ election.start_date|date("l d F Y") }}</time> at <time>{{ election.start_date|time("G:i") }}</time>
<time datetime="{{ election.start_date }}">{{ election.start_date|localtime|date("l d F Y")}}</time>{% trans %} at {% endtrans %}<time>{{ election.start_date|localtime|time("G:i")}}</time>
{% trans %}and will close {% endtrans %}
{%- endif %}
<time datetime="{{ election.end_date }}">{{ election.end_date|date("l d F Y") }}</time> at <time>{{ election.end_date|time("G:i") }}</time>
<time datetime="{{ election.end_date }}">{{ election.end_date|localtime|date("l d F Y")}}</time>{% trans %} at {% endtrans %}<time>{{ election.end_date|localtime|time("G:i")}}</time>
</p>
{%- if election.has_voted(user) %}
<p class="election__elector-infos">

View File

@ -27,15 +27,15 @@
</h4>
<p>
{% trans %}Applications open from{% endtrans %}
<time datetime="{{ election.start_candidature }}">{{ election.start_candidature|date("l d F Y") }}</time> at <time>{{ election.start_candidature|time("G:i") }}</time>
<time datetime="{{ election.start_candidature }}">{{ election.start_candidature|localtime|date("l d F Y") }}</time>{% trans %} at {% endtrans %}<time>{{ election.start_candidature|localtime|time("G:i") }}</time>
{% trans %}to{% endtrans %}
<time datetime="{{ election.end_candidature }}">{{ election.end_candidature|date("l d F Y") }}</time> at <time>{{ election.end_candidature|time("G:i") }}</time>
<time datetime="{{ election.end_candidature }}">{{ election.end_candidature|localtime|date("l d F Y") }}</time>{% trans %} at {% endtrans %}<time>{{ election.end_candidature|time("G:i") }}</time>
</p>
<p>
{% trans %}Polls open from{% endtrans %}
<time datetime="{{ election.start_date }}">{{ election.start_date|date("l d F Y") }}</time> at <time>{{ election.start_date|time("G:i") }}</time>
<time datetime="{{ election.start_date }}">{{ election.start_date|localtime|date("l d F Y") }}</time>{% trans %} at {% endtrans %}<time>{{ election.start_date|localtime|time("G:i") }}</time>
{% trans %}to{% endtrans %}
<time datetime="{{ election.end_date }}">{{ election.end_date|date("l d F Y") }}</time> at <time>{{ election.end_date|time("G:i") }}</time>
<time datetime="{{ election.end_date }}">{{ election.end_date|localtime|date("l d F Y") }}</time>{% trans %} at {% endtrans %}<time>{{ election.end_date|localtime|time("G:i") }}</time>
</p>
<p>{{ election.description }}</p>
</section>

View File

@ -117,19 +117,20 @@ class ElectionForm(forms.ModelForm):
class Meta:
model = Election
fields = ['title', 'description', 'start_candidature', 'end_candidature', 'start_date', 'end_date',
'edit_groups', 'view_groups', 'vote_groups', 'candidature_groups']
'edit_groups', 'view_groups', 'vote_groups', 'candidature_groups']
widgets = {
'edit_groups': CheckboxSelectMultiple,
'view_groups': CheckboxSelectMultiple,
'edit_groups': CheckboxSelectMultiple,
'vote_groups': CheckboxSelectMultiple,
'candidature_groups': CheckboxSelectMultiple,
'start_date': SelectDateTime,
'end_date': SelectDateTime,
'start_candidature': SelectDateTime,
'end_candidature': SelectDateTime,
'candidature_groups': CheckboxSelectMultiple
}
start_date = forms.DateTimeField(['%Y-%m-%d %H:%M:%S'], label=_("Start date"), widget=SelectDateTime, required=True)
end_date = forms.DateTimeField(['%Y-%m-%d %H:%M:%S'], label=_("End date"), widget=SelectDateTime, required=True)
start_candidature = forms.DateTimeField(['%Y-%m-%d %H:%M:%S'], label=_("Start candidature"), widget=SelectDateTime, required=True)
end_candidature = forms.DateTimeField(['%Y-%m-%d %H:%M:%S'], label=_("End candidature"), widget=SelectDateTime, required=True)
# Display elections

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-25 19:56+0100\n"
"POT-Creation-Date: 2016-12-25 23:30+0100\n"
"PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n"
@ -362,7 +362,7 @@ msgstr "Nouveau compte club"
#: counter/templates/counter/counter_list.jinja:47
#: election/templates/election/election_detail.jinja:277
#: election/templates/election/election_detail.jinja:322
#: election/templates/election/election_detail.jinja:366
#: election/templates/election/election_detail.jinja:368
#: election/templates/election/update_template.jinja:4
#: election/templates/election/update_template.jinja:8
#: launderette/templates/launderette/launderette_list.jinja:16
@ -3190,6 +3190,15 @@ msgstr "Votes fermés"
msgid "Polls will open "
msgstr "Les votes ouvriront"
#: election/templates/election/election_detail.jinja:242
#: election/templates/election/election_detail.jinja:245
#: election/templates/election/election_list.jinja:30
#: election/templates/election/election_list.jinja:32
#: election/templates/election/election_list.jinja:36
#: election/templates/election/election_list.jinja:38
msgid " at "
msgstr " à "
#: election/templates/election/election_detail.jinja:243
msgid "and will close "
msgstr "et fermeront"
@ -3236,7 +3245,7 @@ msgstr "Envoyer le vote !"
msgid "Add a new list"
msgstr "Ajouter une nouvelle liste"
#: election/templates/election/election_detail.jinja:365
#: election/templates/election/election_detail.jinja:366
msgid "Add a new role"
msgstr "Ajouter un nouveau rôle"