code: function(str, format) {
             var date = null, formattedBack;
             if(str) {
                 date = this.dpg.parseDate(str, format, this.options.datetimepicker.language, this.options.formatType);
                 if(typeof str === 'string') {
                     formattedBack = this.dpg.formatDate(date, format, this.options.datetimepicker.language, this.options.formatType);
                     if(str !== formattedBack) {
                         date = null;
                     } 
                 }
             }
             return date;
         }
docs: /*
  For incorrect date bootstrap-datetimepicker returns current date that is not suitable
  for datetimefield.
  This function returns null for incorrect date.