Commit 5778f8459593ce41f7fb1e52cb9eb2543baff9c2

Authored by Zambom
1 parent 474c09da

Fixing date input in replicate course

courses/templates/course/create.html
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 <div class="form-group {% if form.has_error %} has-error {% endif %} is-fileinput"> 19 <div class="form-group {% if form.has_error %} has-error {% endif %} is-fileinput">
20 <label for="{{ field.auto_id }}">{{ field.label }}</label> 20 <label for="{{ field.auto_id }}">{{ field.label }}</label>
21 {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%} 21 {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%}
22 - <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'Y-m-d'}}"> 22 + <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}">
23 {% elif field.auto_id == 'id_image' %} 23 {% elif field.auto_id == 'id_image' %}
24 {% render_field field class='form-control' %} 24 {% render_field field class='form-control' %}
25 <div class="input-group"> 25 <div class="input-group">
courses/templates/course/replicate.html
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 <label for="id_init_register_date">{% trans 'Course registration start date' %}</label> 57 <label for="id_init_register_date">{% trans 'Course registration start date' %}</label>
58 58
59 59
60 - <input type="date" class="form-control" name="init_register_date" value="None" min="2016-10-24"> 60 + <input type="text" class="form-control date-picker" name="init_register_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}">
61 61
62 <span class="help-block">{% trans 'Date that starts the registration period of the course (dd/mm/yyyy)' %}</span> 62 <span class="help-block">{% trans 'Date that starts the registration period of the course (dd/mm/yyyy)' %}</span>
63 63
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 <label for="id_end_register_date">{% trans 'Course registration end date' %}</label> 67 <label for="id_end_register_date">{% trans 'Course registration end date' %}</label>
68 68
69 69
70 - <input type="date" class="form-control" name="end_register_date" value="None" min="2016-10-24"> 70 + <input type="text" class="form-control date-picker" name="end_register_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}">
71 71
72 <span class="help-block">{% trans 'Date that ends the registration period of the course (dd/mm/yyyy)' %}</span> 72 <span class="help-block">{% trans 'Date that ends the registration period of the course (dd/mm/yyyy)' %}</span>
73 73
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 <label for="id_init_date">{% trans 'Course start date' %}</label> 77 <label for="id_init_date">{% trans 'Course start date' %}</label>
78 78
79 79
80 - <input type="date" class="form-control" name="init_date" value="None" min="2016-10-24"> 80 + <input type="text" class="form-control date-picker" name="init_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}">
81 81
82 <span class="help-block">{% trans 'Date that the course starts (dd/mm/yyyy)' %}</span> 82 <span class="help-block">{% trans 'Date that the course starts (dd/mm/yyyy)' %}</span>
83 83
@@ -87,7 +87,7 @@ @@ -87,7 +87,7 @@
87 <label for="id_end_date">{% trans 'Course end date' %}</label> 87 <label for="id_end_date">{% trans 'Course end date' %}</label>
88 88
89 89
90 - <input type="date" class="form-control" name="end_date" value="None" min="2016-10-24"> 90 + <input type="text" class="form-control date-picker" name="end_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}">
91 91
92 <span class="help-block">{% trans 'Date that the course ends (dd/mm/yyyy)' %}</span> 92 <span class="help-block">{% trans 'Date that the course ends (dd/mm/yyyy)' %}</span>
93 93