Latest

Tuesday, July 11, 2017

ui-datepicker laravel validate format

Asked by: chaima wetcha


i am using the ui-datpicker de jquery like this way

 var dates = $("#datepicker, #datepicker_2").datepicker({
        dateFormat: 'DD. d MM. yy',

        defaultDate: "+1w",
        changeMonth: false,
        numberOfMonths: 1,
        minDate: dateToday,
        onSelect: function(selectedDate) {
            var option = this.id == "datepicker" ? "minDate" : "maxDate",
                instance = $(this).data("datepicker"),
                date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
            dates.not(this).datepicker("option", option, date);
        }
    });

and i try to validate this date using laravel validator like this :

 'date_validation' => 'required|date_format:"l. d F.y"',

but it always give me this error

The date validation does not match the format l. d F.y

.. any help please .. i am stack here



Source

No comments:

Post a Comment

Adbox