mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-12-22 09:40:23 -05:00
Allow the date picker to be configured without time
This commit is contained in:
parent
51d681af63
commit
afce4734c1
3 changed files with 5 additions and 4 deletions
|
@ -205,7 +205,8 @@ Models with their `$dashboard_type` set to `edit` also use:
|
|||
* `string`: Single-line text input field
|
||||
* `text`: Multi-line text input field
|
||||
* `currency`: Text input field for currency data
|
||||
* `date`: Date and time selection tool for date/time data
|
||||
* `date`: Date selection tool for date/time data
|
||||
* `date-time`: Date and time selection tool for date/time data
|
||||
* `mkd`: Multi-line text input field with a markdown editor
|
||||
* `select`: Text input via option select
|
||||
* `list`: One or more items saved to a connected table
|
||||
|
|
2
resources/js/dashboard.js
vendored
2
resources/js/dashboard.js
vendored
|
@ -671,7 +671,7 @@ function editItemInit() {
|
|||
// enable the datepicker for date-picker elements
|
||||
$datePickers.each(function() {
|
||||
$(this).flatpickr({
|
||||
enableTime: true
|
||||
enableTime: $(this).data("type") === "date-time"
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
<textarea class="text-input" name="{{ $column['name'] }}" id="{{ $column['name'] }}">{{ $value }}</textarea>
|
||||
@elseif($type == 'currency')
|
||||
<input class="currency-input" type="text" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value }}" autocomplete="off" />
|
||||
@elseif($type == 'date')
|
||||
<input class="date-picker" type="text" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value == '' ? date('Y-m-d', time()) : preg_replace('/:[0-9][0-9]$/', '', $value) }}" />
|
||||
@elseif($type == 'date' || $type == 'date-time')
|
||||
<input class="date-picker" type="text" name="{{ $column['name'] }}" id="{{ $column['name'] }}" data-type="{{ $type }}" value="{{ $value == '' ? date('Y-m-d', time()) : preg_replace('/:[0-9][0-9]$/', '', $value) }}" />
|
||||
@elseif($type == 'mkd')
|
||||
<div class="mkd-editor-container">
|
||||
<textarea class="mkd-editor" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value }}"></textarea>
|
||||
|
|
Loading…
Reference in a new issue