<commit_before>/*global Cosmoz, moment */

if (typeof Cosmoz === 'undefined') {
	var Cosmoz = {};
}

(function () {

	'use strict';

	/** @polymerBehavior */
	Cosmoz.DateHelperBehavior = {
		isoDate: function (date) {
			date = this.ensureDate(date);
			if (!date) {
				return '';
			}
			return moment(date).format('YYYY-MM-DD');
		},
		isoDT: function (date) {
			date = this.ensureDate(date);
			if (!date) {
				return '';
			}
			return moment(date).format('YYYY-MM-DD HH:mm:ss');
		},
		/**
		 * Check if date is in the past
		 * @param  {date/string} date Date to check
		 * @return {boolean}      In the past?
		 */
		pastDate: function (date) {
			date = this.ensureDate(date);
			if (!date) {
				return '';
			}
			if (date > new Date()) {
				return false;
			}
			return true;
		},
		/**
		 * Get human readable string describing date's difference from now
		 * @param  {date} date Date to check
		 * @return {String}   Date representation string
		 */
		timeago: function (date) {
			date = this.ensureDate(date);
			if (!date) {
				return '';
			}
			return moment(date).fromNow();
		},
		renderDate: function (date) {
			return this.isoDate(date);
		},
		renderDatetime: function (date) {
			return this.isoDT(date);
		},
		ensureDate: function (date) {
			if (date === undefined) {
				return;
			}
			if (date instanceof Date) {
				return date;
			}
			try {
				date = new Date(date);
			} catch (err) {
				return;
			}
			return date;
		},
		dayDiff: function (date1, date2) {
			date1 = this.ensureDate(date1);
			date2 = this.ensureDate(date2);
			return Math.round((date1 - date2) / (1000 * 60 * 60 * 24));
		}
	};

}());<commit_msg>ESLINT DateHelperBehavior<commit_after>/*global Cosmoz, moment */

if (typeof Cosmoz === 'undefined') {
	var Cosmoz = {};
}

(function () {

	'use strict';

	/** @polymerBehavior */
	Cosmoz.DateHelperBehavior = {

		isoDate: function (date) {
			var ensuredDate = this.ensureDate(date);
			if (!ensuredDate) {
				return '';
			}
			return moment(ensuredDate).format('YYYY-MM-DD');
		},

		isoDT: function (date) {
			var ensuredDate = this.ensureDate(date);
			if (!ensuredDate) {
				return '';
			}
			return moment(ensuredDate).format('YYYY-MM-DD HH:mm:ss');
		},

		/**
		 * Check if date is in the past
		 * @param  {date/string} date Date to check
		 * @return {boolean}      In the past?
		 */
		pastDate: function (date) {
			var ensuredDate = this.ensureDate(date);
			if (!ensuredDate) {
				return '';
			}
			if (ensuredDate > new Date()) {
				return false;
			}
			return true;
		},
		/**
		 * Get human readable string describing date's difference from now
		 * @param  {date} date Date to check
		 * @return {String}   Date representation string
		 */
		timeago: function (date) {
			var ensuredDate = this.ensureDate(date);
			if (!ensuredDate) {
				return '';
			}
			return moment(ensuredDate).fromNow();
		},
		renderDate: function (date) {
			return this.isoDate(date);
		},
		renderDatetime: function (date) {
			return this.isoDT(date);
		},
		ensureDate: function (date) {
			var ensuredDate;
			if (date === undefined) {
				return;
			}
			if (date instanceof Date) {
				return date;
			}
			try {
				ensuredDate = new Date(date);
			} catch (err) {
				return;
			}
			return ensuredDate;
		},
		dayDiff: function (date1, date2) {
			var ensuredDate1 = this.ensureDate(date1)
				, ensuredDate2 = this.ensureDate(date2);
			return Math.round((ensuredDate1 - ensuredDate2) / (1000 * 60 * 60 * 24));
		}
	};

}());
{'fraction_non_alphanumeric': 0.15329717385098487, 'fraction_numerical': 0.010276905509563231, 'mean_word_length': 2.7636949516648763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1756637', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1177, 'n_words': 300}