Skip to content Skip to sidebar Skip to footer

Jquery Datepicker Set To Null

I have a problem with setting a date to Null in my table. I have datepicker that is by default blank (and when I save, it return to DB as 0000-00-00 but I want to set as Null. In c

Solution 1:

It is recommended that you should set minimum DateTime value in the table of your DataBase instead of null for dates.

Whereas if you want to store in string format, then you can use :

$('#datum_kontakta_picker').val() ? $('#datum_kontakta_picker').val() : null;

Solution 2:

try defaultdate blank

defaultDate:''

try somthing like this also

 $('#datum_kontakta_picker').datetimepicker({
    format: 'YYYY/MM/DD',  
    minDate: 0,            
        }
function(start, end, label) {
        console.log(start.toISOString(), end.toISOString(), label);
      }
    }).val('');

Post a Comment for "Jquery Datepicker Set To Null"