<commit_before>import Joi from 'joi';
import moment from 'moment';

const validate = function(value){
  return moment(value, 'DDMMYYYY').isValid();
};
let DateConcat = '';

const invalidFullDateRule = {
  name: 'fulldate',
  description: 'should be a valid Date',
  validate(params, value, state, options){
    DateConcat = value.day.toString() + value.month.toString() + value.year.toString();
    if(validate(DateConcat)){
      return value;
    } else {
      return this.createError('object.fulldate', { v: value.day }, state, options);
    }
  }
};

export default {
  base: Joi.object(),
  name: 'object',
  language: {
    fulldate: 'Fulldate error',
  },<commit_msg>fixed. leading zero for month<commit_after>import Joi from 'joi';
import moment from 'moment';

const validate = function(value){
  return moment(value, 'DDMMYYYY').isValid();
};
let DateConcat = '';

const invalidFullDateRule = {
  name: 'fulldate',
  description: 'should be a valid Date',
  validate(params, value, state, options){
    let mm = "0" + value.month.toString();
    mm.slice(-2);
    DateConcat = value.day.toString() + mm + value.year.toString();
    console.log(DateConcat);
    if(validate(DateConcat)){
      return value;
    } else {
      return this.createError('object.fulldate', { v: value.day }, state, options);
    }
  }
};

export default {
  base: Joi.object(),
  name: 'object',
  language: {
    fulldate: 'Fulldate error',
  },
{'fraction_non_alphanumeric': 0.15529247910863508, 'fraction_numerical': 0.001392757660167131, 'mean_word_length': 3.7740863787375414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '661660', 'n_tokens_mistral': 470, 'n_tokens_neox': 471, 'n_words': 118}