<commit_before>/*	VCO.Date
	Date object
================================================== */
VCO.Date = VCO.Class.extend({
	
	initialize: function (data) {
		this.data = {
			year: 			"",
			month: 			"",
			day: 			"",
			hour: 			"",
			minute: 		"",
			second: 		"",
			millisecond: 	"",
			format: 		"YYYY MM DD",
			display_type: 	"April 30th, 1995",
			date_obj: 		{}
		};

		// Merge Data
		VCO.Util.mergeData(this.data, data);

		// Create Date Object
		this._createDateObj();
		
		// Creat Display Type
		if (this.data.date_obj.getMonth) {
			this._createDisplayType();
		}
		
	},
	
	/*	Private Methods
	================================================== */
	_setLanguage: function(lang) {
		VCO.Util.mergeData(this.dateformats, lang);
		/*
		this.dateformats					=	lang.dateformats;	
		this.date_dict.month				=	lang.date.month;
		this.date_dict.month_abbr			=	lang.date.month_abbr;
		this.date_dict.day					=	lang.date.day;
		this.date_dict.day_abbr				=	lang.date.day_abbr;
		this.dateformats.i18n.dayNames		=	lang.date.day_abbr.concat(lang.date.day);
		this.dateformats.i18n.monthNames	=	lang.date.month_abbr.concat(lang.date.month);
		*/
	},
	
	/*	Create Display Type
	================================================== */
	_setDateFormat: function() {
		// Set display Type
		this.data.format = "YYYY MM DD";
	},
	
	/*	Create Display Type
	================================================== */
	_createDisplayType: function() {
		// Set display Type
		//this.data.display_type = VCO.DateFormat.create(this.data.date_obj, this.data.format);
	},
	
	/*	Create JavaScript date object
	================================================== */
	_createDateObj: function() {
		var _date = {
			year: 			0,
			month: 			0,
			day: 			0,
			hour: 			0,
			minute: 		0,
			second: 		0,
			millisecond: 	0
		};
		
		// Merge dates
		VCO.Util.mergeData(_date, this.data);
		
		// Make strings into numbers
		for (var key in _date) {
			_date[key] = parseInt(_date[key])
		}
		
		// Create Javascript date object<commit_msg>don't let NaN into date obj<commit_after>/*	VCO.Date
	Date object
================================================== */
VCO.Date = VCO.Class.extend({
	
	initialize: function (data) {
		this.data = {
			year: 			"",
			month: 			"",
			day: 			"",
			hour: 			"",
			minute: 		"",
			second: 		"",
			millisecond: 	"",
			format: 		"YYYY MM DD",
			display_type: 	"April 30th, 1995",
			date_obj: 		{}
		};

		// Merge Data
		VCO.Util.mergeData(this.data, data);

		// Create Date Object
		this._createDateObj();
		
		// Creat Display Type
		if (this.data.date_obj.getMonth) {
			this._createDisplayType();
		}
		
	},
	
	/*	Private Methods
	================================================== */
	_setLanguage: function(lang) {
		VCO.Util.mergeData(this.dateformats, lang);
		/*
		this.dateformats					=	lang.dateformats;	
		this.date_dict.month				=	lang.date.month;
		this.date_dict.month_abbr			=	lang.date.month_abbr;
		this.date_dict.day					=	lang.date.day;
		this.date_dict.day_abbr				=	lang.date.day_abbr;
		this.dateformats.i18n.dayNames		=	lang.date.day_abbr.concat(lang.date.day);
		this.dateformats.i18n.monthNames	=	lang.date.month_abbr.concat(lang.date.month);
		*/
	},
	
	/*	Create Display Type
	================================================== */
	_setDateFormat: function() {
		// Set display Type
		this.data.format = "YYYY MM DD";
	},
	
	/*	Create Display Type
	================================================== */
	_createDisplayType: function() {
		// Set display Type
		//this.data.display_type = VCO.DateFormat.create(this.data.date_obj, this.data.format);
	},
	
	/*	Create JavaScript date object
	================================================== */
	_createDateObj: function() {
		var _date = {
			year: 			0,
			month: 			0,
			day: 			0,
			hour: 			0,
			minute: 		0,
			second: 		0,
			millisecond: 	0
		};
		
		// Merge dates
		VCO.Util.mergeData(_date, this.data);
		
		// Make strings into numbers
		for (var key in _date) {
			var parsed = parseInt(_date[key]);
			if (isNaN(parsed)) parsed = 0;
			_date[key] = parsed;
		}
		
		// Create Javascript date object
{'fraction_non_alphanumeric': 0.2499393351128367, 'fraction_numerical': 0.008493084202863382, 'mean_word_length': 3.045142296368989, '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': '2981889', 'n_tokens_mistral': 1754, 'n_tokens_neox': 1457, 'n_words': 259}