2

I'm using a form which includes a date field in Laravel. I would like to disable the weekends and customs dates. For example, the Wednesday 08/11/2017.

Is it possible to do it? I only know how to disable dates before or after a date but not individual dates and I can't find the solution.

My current code:

{!! Form::date('request_date', null, ['class' => 'form-control', 'min' =>  date('Y-m-d')]) !!}

Many thanks.

Alejandro
  • 113
  • 2
  • 11

2 Answers2

1

As mentioned in the comments use a JS Library. One i use is Bootstrap Datepicker

You can use the options to disable dates.Docs

rbaskam
  • 749
  • 7
  • 22
0

You can use Bootstrap Datepicker, but there are a few problems with that, principally in datepicker you can change the format of your date to show it, but when you try to store it, it takes the format that you put it, and if you want to store it in a different format, you must to use a Mutator.

for example: If you want to show it in a format (dd/mm/yyyy) but you want to store it in a format (yyyy/mm/dd) you need to convert the date.