mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 11:06:36 +00:00
Optimized datetimepicker (references #1478)
This commit is contained in:
@@ -86,7 +86,7 @@ Grocy.Components.DateTimePicker.Init = function(reInit = false)
|
||||
{
|
||||
format: $(this).find("input").data('format'),
|
||||
buttons: {
|
||||
showToday: true,
|
||||
showToday: Grocy.Components.DateTimePicker.GetInputElement().data('limit-end-to-now') !== true,
|
||||
showClose: true
|
||||
},
|
||||
calendarWeeks: Grocy.CalendarShowWeekNumbers,
|
||||
@@ -101,9 +101,9 @@ Grocy.Components.DateTimePicker.Init = function(reInit = false)
|
||||
down: 'fas fa-arrow-down',
|
||||
previous: 'fas fa-chevron-left',
|
||||
next: 'fas fa-chevron-right',
|
||||
today: 'fas fa-calendar-check',
|
||||
today: 'fas fa-calendar-day',
|
||||
clear: 'far fa-trash-alt',
|
||||
close: 'far fa-times-circle'
|
||||
close: 'fas fa-check'
|
||||
},
|
||||
sideBySide: true,
|
||||
keyBinds: {
|
||||
|
@@ -86,7 +86,7 @@ Grocy.Components.DateTimePicker2.Init = function(reInit = false)
|
||||
{
|
||||
format: $(this).find("input").data('format'),
|
||||
buttons: {
|
||||
showToday: true,
|
||||
showToday: Grocy.Components.DateTimePicker2.GetInputElement().data('limit-end-to-now') !== true,
|
||||
showClose: true
|
||||
},
|
||||
calendarWeeks: Grocy.CalendarShowWeekNumbers,
|
||||
@@ -101,9 +101,9 @@ Grocy.Components.DateTimePicker2.Init = function(reInit = false)
|
||||
down: 'fas fa-arrow-down',
|
||||
previous: 'fas fa-chevron-left',
|
||||
next: 'fas fa-chevron-right',
|
||||
today: 'fas fa-calendar-check',
|
||||
today: 'fas fa-calendar-day',
|
||||
clear: 'far fa-trash-alt',
|
||||
close: 'far fa-times-circle'
|
||||
close: 'fas fa-check'
|
||||
},
|
||||
sideBySide: true,
|
||||
keyBinds: {
|
||||
|
@@ -46,10 +46,8 @@
|
||||
inputmode="numeric"
|
||||
@endif
|
||||
@if($isRequired)
|
||||
@if($isRequired)
|
||||
required
|
||||
@endif
|
||||
@endif
|
||||
class="form-control datetimepicker-input @if(!empty($additionalCssClasses)){{ $additionalCssClasses }}@endif"
|
||||
data-target="#{{ $id }}"
|
||||
data-format="{{ $format }}"
|
||||
|
@@ -16,6 +16,7 @@
|
||||
@php if(!isset($nextInputSelector)) { $nextInputSelector = false; } @endphp
|
||||
@php if(empty($additionalAttributes)) { $additionalAttributes = ''; } @endphp
|
||||
@php if(empty($additionalGroupCssClasses)) { $additionalGroupCssClasses = ''; } @endphp
|
||||
@php if(empty($activateNumberPad)) { $activateNumberPad = false; } @endphp
|
||||
|
||||
<div class="datetimepicker2-wrapper form-group {{ $additionalGroupCssClasses }}">
|
||||
<label for="{{ $id }}">{{ $__t($label) }}
|
||||
@@ -41,11 +42,12 @@
|
||||
$additionalAttributes
|
||||
!!}
|
||||
type="text"
|
||||
@if($isRequired)
|
||||
@if($activateNumberPad)
|
||||
inputmode="numeric"
|
||||
@endif
|
||||
@if($isRequired)
|
||||
required
|
||||
@endif
|
||||
@endif
|
||||
class="form-control datetimepicker2-input @if(!empty($additionalCssClasses)){{ $additionalCssClasses }}@endif"
|
||||
data-target="#{{ $id }}"
|
||||
data-format="{{ $format }}"
|
||||
|
Reference in New Issue
Block a user