Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateRange on the phone cannot select a time range #2735

Open
TuanAnh0907 opened this issue Oct 21, 2023 · 2 comments
Open

DateRange on the phone cannot select a time range #2735

TuanAnh0907 opened this issue Oct 21, 2023 · 2 comments
Assignees
Labels

Comments

@TuanAnh0907
Copy link

TuanAnh0907 commented Oct 21, 2023

Describe the bug
I can't select the time period when using DateRange on my phone but on my PC it works fine
https://orchid.software/en/docs/field/#daterange

@TuanAnh0907
Copy link
Author

image

On mobile, you can only choose one

@Toshkq93
Copy link

Toshkq93 commented Dec 14, 2023

@TuanAnh0907

you need to create a custom class in php, set attributes field disableMobile, than create custom controller on JS and view. Will change for you controller name in view all data.
`
class DateRangeCustom extends Field implements ComplexFieldConcern
{
/**
* @var string
*/
protected $view = 'fields.dataRange';

protected $attributes = [
    'disableMobile' => 'true'
];

/**
 * Attributes available for a particular tag.
 *
 * @var array
 */
protected $inlineAttributes = [
    'form',
    'name',
];

}
`

and than in your view in div add data attribute
`<div class="row"
data-controller="datetimeCustom"
data-datetimeCustom-disable-mobile="{{$disableMobile}}"
data-datetimeCustom-allow-input="true"
data-datetimeCustom-range="#end_{{ \Illuminate\Support\Str::slug($attributes['name']) }}"

"`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants