mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-11 07:12:57 +02:00
feat(datepicker): drop native datepickers in favor of AirDatePicker for better compatibility
As Firefox (still) doesn't support month input type
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label={% translate 'Close' %}></button>
|
||||
</div>
|
||||
<div id="generic-offcanvas-body" class="offcanvas-body"
|
||||
_="install init_tom_select">
|
||||
_="install init_tom_select
|
||||
install init_datepicker">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
|
||||
@@ -3,19 +3,18 @@
|
||||
{% javascript_pack 'bootstrap' attrs="defer" %}
|
||||
{% javascript_pack 'sweetalert2' attrs="defer" %}
|
||||
{% javascript_pack 'select' attrs="defer" %}
|
||||
{% javascript_pack 'datepicker' %}
|
||||
|
||||
{% include 'includes/scripts/hyperscript/init_tom_select.html' %}
|
||||
{% include 'includes/scripts/hyperscript/init_date_picker.html' %}
|
||||
{% include 'includes/scripts/hyperscript/hide_amount.html' %}
|
||||
{% include 'includes/scripts/hyperscript/tooltip.html' %}
|
||||
{% include 'includes/scripts/hyperscript/htmx_error_handler.html' %}
|
||||
{% include 'includes/scripts/hyperscript/sounds.html' %}
|
||||
{% include 'includes/scripts/hyperscript/swal.html' %}
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
|
||||
|
||||
{% javascript_pack 'htmx' attrs="defer" %}
|
||||
{% javascript_pack 'charts' %}
|
||||
{#<script src="https://unpkg.com/htmx-ext-alpine-morph@2.0.0/alpine-morph.js"></script>#}
|
||||
|
||||
|
||||
<script>
|
||||
let tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<script type="text/hyperscript">
|
||||
behavior init_datepicker
|
||||
init
|
||||
set datepickers to <.airdatepickerinput/> in me
|
||||
for x in datepickers
|
||||
js(it)
|
||||
DatePicker(it)
|
||||
end
|
||||
end
|
||||
set datepickers to <.airdatetimepickerinput/> in me
|
||||
for x in datepickers
|
||||
js(it)
|
||||
DatePicker(it)
|
||||
end
|
||||
end
|
||||
set datepickers to <.airmonthyearpickerinput/> in me
|
||||
for x in datepickers
|
||||
MonthYearPicker(it)
|
||||
end
|
||||
end
|
||||
end
|
||||
</script>
|
||||
@@ -8,7 +8,9 @@
|
||||
{% block title %}{% translate 'Currency Converter' %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container px-md-3 py-3 column-gap-5" _="install init_tom_select">
|
||||
<div class="container px-md-3 py-3 column-gap-5"
|
||||
_="install init_tom_select
|
||||
install init_datepicker">
|
||||
<div class="tw-text-3xl fw-bold font-monospace tw-w-full mb-3">
|
||||
<div>{% translate 'Currency Converter' %}</div>
|
||||
</div>
|
||||
|
||||
@@ -124,7 +124,8 @@
|
||||
<div class="collapse" id="collapse-filter">
|
||||
<div class="card card-body">
|
||||
<form _="on change or submit or search trigger updated on window end
|
||||
install init_tom_select"
|
||||
install init_tom_select
|
||||
install init_datepicker"
|
||||
id="filter">
|
||||
{% crispy filter.form %}
|
||||
</form>
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
<hr>
|
||||
<form hx-get="{% url 'transactions_all_list' %}" hx-trigger="change, submit, search"
|
||||
hx-target="#transactions" id="filter" hx-indicator="#transactions"
|
||||
_="install init_tom_select">
|
||||
_="install init_tom_select
|
||||
install init_datepicker">
|
||||
{% crispy filter.form %}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user