In contact form, dates are now dates inpiuts instead of string

This commit is contained in:
Noah Lancien 2024-01-22 09:56:19 +00:00
parent d162f87f3e
commit 54e501cd03
3 changed files with 6 additions and 6 deletions

View file

@ -69,7 +69,7 @@ class ContactRequest extends FormRequest
}
],
'product_date_limit' => [
'string', 'between:3,255', 'required',
'required', 'date',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
if ($this->get("object") != ObjectEnum::customerService->value()) {
@ -108,7 +108,7 @@ class ContactRequest extends FormRequest
}
],
'product_date_consumption' => [
'string', 'between:3,255', 'required',
'required', 'date',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
if ($this->get("object") != ObjectEnum::customerService->value()) {

View file

@ -28,10 +28,10 @@
### Information sur le produit:
@component('mail::panel')
- **{{ __('validation.custom.product_name') }}:** {{ $data->product_name ?? '' }}
- **{{ __('validation.custom.product_date_limit') }}:** {{ $data->product_date_limit ?? '' }}
- **{{ __('validation.custom.product_date_limit') }}:** {{ \Carbon\Carbon::make($data->product_date_limit)->format('d/m/Y') ?? '' }}
- **{{ __('validation.custom.product_barcode') }}:** {{ $data->product_barcode ?? '' }}
- **{{ __('validation.custom.product_lot') }}:** {{ $data->product_lot ?? '' }}
- **{{ __('validation.custom.product_date_consumption') }}:** {{ $data->product_date_consumption ?? '' }}
- **{{ __('validation.custom.product_date_consumption') }}:** {{ \Carbon\Carbon::make($data->product_date_consumption)->format('d/m/Y') ?? '' }}
- **{{ __('validation.custom.product_location') }}:** {{ $data->product_location ?? '' }}
@endcomponent
@endif

View file

@ -128,7 +128,7 @@
{{ Str::of(__('validation.custom.product_date_limit'))->ucFirst()->value() }}* :
<span class="text-body-secondary">{{ __('Ex : 25/08/2028') }}</span>
</label>
<input class="form-control" id="product_date_limit" name="product_date_limit"
<input class="form-control" id="product_date_limit" name="product_date_limit" type="date"
value="{{ old('product_date_limit') }}">
</fieldset>
</div>
@ -158,7 +158,7 @@
<span class="text-body-secondary">{{ __('Ex : 25/08/2028') }}</span>
</label>
<input class="form-control" id="product_date_consumption" name="product_date_consumption"
value="{{ old('product_date_consumption') }}">
type="date" value="{{ old('product_date_consumption') }}">
</fieldset>
</div>
<div class="col-12 col-md-6 p-0">