code: function(format) {
        var dt, values = {}, 
        that = this,
        notSelected = false;
  
        //getting selected values    
        angular.forEach(this.map, function(v, k) {
          if(k === 'ampm') {
            return;
          }
          var def = k === 'day' ? 1 : 0;
  
          values[k] = that['$'+k] ? parseInt(that['$'+k].val(), 10) : def; 
          
          if(isNaN(values[k])) {
           notSelected = true;
           return false; 
         }
       });
        
        //if at least one visible combo not selected - return empty string
        if(notSelected) {
         return '';
       }
  
        //convert hours 12h --> 24h 
        if(this.$ampm) {
          //12:00 pm --> 12:00 (24-h format, midday), 12:00 am --> 00:00 (24-h format, midnight, start of day)
          if(values.hour === 12) {
            values.hour = this.$ampm.val() === 'am' ? 0 : 12;                    
          } else {
            values.hour = this.$ampm.val() === 'am' ? values.hour : values.hour+12;
          }
        }
        
        dt = moment([values.year, values.month, values.day, values.hour, values.minute, values.second]);
        
        //highlight invalid date
        this.highlight(dt);
  
        format = format === undefined ? this.options.format : format;
        if(format === null) {
         return dt.isValid() ? dt : null; 
       } else {
         return dt.isValid() ? dt.format(format) : ''; 
       }
     }
docs: /*
  Returns current date value from combos.
  If format not specified - `options.format` used.
  If format = `null` - Moment object returned.