Show a calendar on the shopping list page (just for info purposes)

This commit is contained in:
Bernd Bestel 2018-07-13 22:38:31 +02:00
parent 5d762001c8
commit 31ce7a13ea
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
4 changed files with 58 additions and 1 deletions

View File

@ -144,6 +144,7 @@ return array(
'A best before date is required and must be later than today' => 'Ein Mindesthaltbarkeitsdatum ist erforderlich und muss später als heute sein',
'Settings' => 'Einstellungen',
'This can only be before now' => 'Dies kann nur vor jetzt sein',
'Calendar' => 'Kalender',
//Constants
'manually' => 'Manuell',

View File

@ -0,0 +1,40 @@
$('#calendar').datetimepicker(
{
format: 'L',
buttons: {
showToday: true,
showClose: false
},
calendarWeeks: true,
locale: moment.locale(),
icons: {
time: 'far fa-clock',
date: 'far fa-calendar',
up: 'fas fa-arrow-up',
down: 'fas fa-arrow-down',
previous: 'fas fa-chevron-left',
next: 'fas fa-chevron-right',
today: 'fas fa-calendar-check',
clear: 'far fa-trash-alt',
close: 'far fa-times-circle'
},
keepOpen: true,
inline: true,
keyBinds: {
up: function(widget) { },
down: function(widget) { },
'control up': function(widget) { },
'control down': function(widget) { },
left: function(widget) { },
right: function(widget) { },
pageUp: function(widget) { },
pageDown: function(widget) { },
enter: function(widget) { },
escape: function(widget) { },
'control space': function(widget) { },
t: function(widget) { },
'delete': function(widget) { }
}
});
$('#calendar').datetimepicker('show');

View File

@ -0,0 +1,12 @@
@push('componentScripts')
<script src="{{ $U('/viewjs/components/calendarcard.js', true) }}?v={{ $version }}"></script>
@endpush
<div class="card">
<div class="card-header">
<i class="fas fa-calendar"></i> {{ $L('Calendar') }}
</div>
<div class="card-body">
<div id="calendar" data-target-input="nearest"></div>
</div>
</div>

View File

@ -27,7 +27,7 @@
</div>
<div class="row">
<div class="col">
<div class="col-xs-12 col-md-8 pb-3">
<table id="shoppinglist-table" class="table table-sm table-striped dt-responsive">
<thead>
<tr>
@ -58,5 +58,9 @@
</tbody>
</table>
</div>
<div class="col-xs-12 col-md-4">
@include('components.calendarcard')
</div>
</div>
@stop