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