Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
prevent usage of the js datepicker, when using html5 fields (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Strobel authored and kevinpapst committed Sep 16, 2019
1 parent 12c5dea commit f5bf4ec
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
24 changes: 14 additions & 10 deletions Resources/views/layout/form-theme-base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
<i class="far fa-calendar-alt"></i>
</div>

{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% if type is not defined or type != 'date' %}
{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-datepickerenable':'on'}) %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-datepickerenable':'on'}) %}

{{ block('form_widget_simple') }}
</div>
Expand All @@ -144,12 +146,14 @@
<div class="input-group-addon add-on">
<i class="far fa-clock"></i>
</div>
{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% if type is not defined or type != 'time' %}
{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-timepicker':'on'}) %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-timepicker':'on'}) %}
{{ block('form_widget_simple') }}
</div>
</div>
Expand Down
24 changes: 14 additions & 10 deletions Resources/views/layout/form-theme-horizontal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
<i class="far fa-calendar-alt"></i>
</div>

{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% if type is not defined or type != 'date' %}
{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-datepickerenable':'on'}) %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-datepickerenable':'on'}) %}

{{ block('form_widget_simple') }}
</div>
Expand All @@ -144,12 +146,14 @@
<div class="input-group-addon add-on">
<i class="far fa-clock"></i>
</div>
{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% if type is not defined or type != 'time' %}
{% if attr.class is defined %}
{% set class = attr.class ~ ' timepicker' %}
{% else %}
{% set class = ' timepicker' %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-timepicker':'on'}) %}
{% endif %}
{% set attr = attr|merge({'class' : class, 'data-timepicker':'on'}) %}
{{ block('form_widget_simple') }}
</div>
</div>
Expand Down

0 comments on commit f5bf4ec

Please sign in to comment.