Always use bootstrap datepicker

This commit is contained in:
Ozzie Isaacs
2021-05-14 19:58:06 +02:00
parent eba94f430c
commit b009dfe4ee
5 changed files with 68 additions and 80 deletions
+13 -9
View File
@@ -105,12 +105,13 @@
</div>
{% endif %}
{% endif %}
<div class="form-group">
<label for="pubdate">{{_('Published Date')}}</label>
<div style="position: relative">
<input type="date" class="form-control" name="pubdate" id="pubdate" value="{% if book.pubdate %}{{book.pubdate|formatdateinput}}{% endif %}">
<input type="text" class="form-control fake-input hidden" id="fake_pubdate" value="{% if book.pubdate %}{{book.pubdate|formatdate}}{% endif %}">
</div>
<label for="pubdate">{{_('Published Date')}}</label>
<div class="form-group input-group">
<input type="text" style="position: static;" class="datepicker form-control" name="pubdate" id="pubdate" value="{% if book.pubdate %}{{book.pubdate|formatdateinput}}{% endif %}">
<input type="text" style="position: absolute;" class="form-control fake-input hidden" id="fake_pubdate" value="{% if book.pubdate %}{{book.pubdate|formatdate}}{% endif %}">
<span class="input-group-btn">
<button type="button" id="pubdate_delete" class="datepicker_delete btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></button>
</span>
</div>
<div class="form-group">
<label for="publisher">{{_('Publisher')}}</label>
@@ -150,15 +151,18 @@
{% endif %}
{% if c.datatype == 'datetime' %}
<div style="position: relative">
<input type="date" class="form-control" name="{{ 'custom_column_' ~ c.id }}" id="{{ 'custom_column_' ~ c.id }}"
<div class="input-group">
<input type="text" style="position: static;" class="datepicker form-control" name="{{ 'custom_column_' ~ c.id }}" id="{{ 'custom_column_' ~ c.id }}"
{% if book['custom_column_' ~ c.id]|length > 0 %}
value="{% if book['custom_column_' ~ c.id][0].value %}{{ book['custom_column_' ~ c.id][0].value|formatdateinput}}{% endif %}"
{% endif %}>
<input type="text" class="fake_custom_column_{{ c.id }} form-control fake-input hidden "
<input type="text" style="position: absolute;" class="fake_custom_column_{{ c.id }} form-control fake-input hidden" id="fake_pubdate"
{% if book['custom_column_' ~ c.id]|length > 0 %}
value="{% if book['custom_column_' ~ c.id][0].value %}{{book['custom_column_' ~ c.id][0].value|formatdate}}{% endif %}"
{% endif %}>
<span class="input-group-btn">
<button type="button" class="datepicker_delete btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></button>
</span>
</div>
{% endif %}
+26 -14
View File
@@ -18,16 +18,22 @@
<div class="row">
<div class="form-group col-sm-6">
<label for="Publishstart">{{_('Published Date From')}}</label>
<div style="position: relative">
<input type="date" class="form-control" name="Publishstart" id="Publishstart" value="">
<input type="text" class="form-control fake-input hidden" id="fake_Publishstart" value="">
<div class="input-group">
<input type="text" style="position: static;" class="datepicker form-control" name="Publishstart" id="Publishstart" value="">
<input type="text" style="position: absolute;" class="form-control fake-input hidden" id="fake_Publishstart" value="">
<span class="input-group-btn">
<button type="button" id="pubstart_delete" class="datepicker_delete btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></button>
</span>
</div>
</div>
<div class="form-group col-sm-6">
<label for="Publishend">{{_('Published Date To')}}</label>
<div style="position: relative">
<input type="date" class="form-control" name="Publishend" id="Publishend" value="">
<input type="text" class="form-control fake-input hidden" id="fake_Publishend" value="">
<div class="input-group ">
<input type="text" style="position: static;" class="datepicker form-control" name="Publishend" id="Publishend" value="">
<input type="text" style="position: absolute;" class="form-control fake-input hidden" id="fake_Publishend" value="">
<span class="input-group-btn">
<button type="button" id="pubend_delete" class="datepicker_delete btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></button>
</span>
</div>
</div>
</div>
@@ -170,17 +176,23 @@
{% if c.datatype == 'datetime' %}
<div class="row">
<div class="form-group col-sm-6">
<label for="{{ 'custom_column_' ~ c.id }}">{{_('From:')}}</label>
<div style="position: relative">
<input type="date" class="form-control" name="{{ 'custom_column_' ~ c.id }}_start" id="{{ 'custom_column_' ~ c.id }}_start" value="">
<input type="text" class="form-control fake-input hidden" id="fake_{{ 'custom_column_' ~ c.id }}_start" value="">
<label for="{{ 'custom_column_' ~ c.id }}">{{_('From:')}}</label>
<div class="input-group">
<input type="text" style="position: static;" class="datepicker form-control" name="{{ 'custom_column_' ~ c.id }}_start" id="{{ 'custom_column_' ~ c.id }}_start" value="">
<input type="text" style="position: absolute;" class="form-control fake-input hidden" id="fake_{{ 'custom_column_' ~ c.id }}_start" value="">
<span class="input-group-btn">
<button type="button" id="pubstart_delete" class="datepicker_delete btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></button>
</span>
</div>
</div>
<div class="form-group col-sm-6">
<label for="{{ 'custom_column_' ~ c.id }}">{{_('To:')}}</label>
<div style="position: relative">
<input type="date" class="form-control" name="{{ 'custom_column_' ~ c.id }}_end" id="{{ 'custom_column_' ~ c.id }}_end" value="">
<input type="text" class="form-control fake-input hidden" id="fake_{{ 'custom_column_' ~ c.id }}_end" value="">
<label for="{{ 'custom_column_' ~ c.id }}">{{_('To:')}}</label>
<div class="input-group ">
<input type="text" style="position: static;" class="datepicker form-control" name="{{ 'custom_column_' ~ c.id }}_end" id="{{ 'custom_column_' ~ c.id }}_end" value="">
<input type="text" style="position: absolute;" class="form-control fake-input hidden" id="fake_{{ 'custom_column_' ~ c.id }}_end" value="">
<span class="input-group-btn">
<button type="button" id="pubend_delete" class="datepicker_delete btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></button>
</span>
</div>
</div>
</div>