<commit_before>/* Magic Mirror Module: calendar_monthly
 * v1.0 - June 2016
 *
 * By <NAME> <<EMAIL>>
 * Beer Licensed (meaning, if you like this module, feel free to have a beer on me, or send me one.)
 */

 Module.register("calendar_monthly", {

	// Module defaults
	defaults: {
		fadeSpeed: 2 * 1000,		// fade out and in for 2 seconds
		showHeader: true,
		cssStyle: "block",
		initialLoadDelay: 0
	},

	// Required styles
	getStyles: function() {
		switch(this.config.cssStyle) {
			case "block":
				/* This is the default styling */
				return ["styles.css", "styleBlock.css"];
				break;
			case "slate":
				return ["styles.css", "styleSlate.css"];
				break;
			case "custom":
				return ["styles.css", "styleCustom.css"];
				break;
			default:
				return ["styles.css"];
		}
	},

	// Required scripts
	getScripts: function() {
		return ["moment.js"];
	},

	// Override start method
	start: function() {
		Log.log("Starting module: " + this.name);
		// Set locale
		moment.locale(config.language);
		
		// Calculate next midnight and add 5 seconds to avoid colliding with the clock at exact midnight
		var now = moment();
		this.midnight = moment([now.year(), now.month(), now.date() + 1]).add(5, "seconds");

		this.loaded = false;
		this.DEBUG = true; // Use for debugging purposes only, please set to 'false' in final release

		this.scheduleUpdate(this.config.initialLoadDelay);
	},

	// Override dom generator
	getDom: function() {

		if ((moment() > this.midnight) || (!this.loaded)) {

			var month = moment().month();
			var year = moment().year();
			var monthName = moment().format("MMMM");
			var monthLength = moment().daysInMonth();

			// Find first day of the month, LOCALE aware
			var startingDay = moment().date(1).weekday();

			var wrapper = document.createElement("table");
			wrapper.className = 'xsmall';
			wrapper.id = 'calendar-table';

			// Create THEAD section with month name and 4-digit year<commit_msg>Turned DEBUG off<commit_after>/* Magic Mirror Module: calendar_monthly
 * v1.0 - June 2016
 *
 * By <NAME> <<EMAIL>>
 * Beer Licensed (meaning, if you like this module, feel free to have a beer on me, or send me one.)
 */

 Module.register("calendar_monthly", {

	// Module defaults
	defaults: {
		fadeSpeed: 2 * 1000,		// fade out and in for 2 seconds
		showHeader: true,
		cssStyle: "block",
		initialLoadDelay: 0
	},

	// Required styles
	getStyles: function() {
		switch(this.config.cssStyle) {
			case "block":
				/* This is the default styling */
				return ["styles.css", "styleBlock.css"];
				break;
			case "slate":
				return ["styles.css", "styleSlate.css"];
				break;
			case "custom":
				return ["styles.css", "styleCustom.css"];
				break;
			default:
				return ["styles.css"];
		}
	},

	// Required scripts
	getScripts: function() {
		return ["moment.js"];
	},

	// Override start method
	start: function() {
		Log.log("Starting module: " + this.name);
		// Set locale
		moment.locale(config.language);
		
		// Calculate next midnight and add 5 seconds to avoid colliding with the clock at exact midnight
		var now = moment();
		this.midnight = moment([now.year(), now.month(), now.date() + 1]).add(5, "seconds");

		this.loaded = false;
		this.DEBUG = false; // Use for debugging purposes only, please set to 'false' in final release

		this.scheduleUpdate(this.config.initialLoadDelay);
	},

	// Override dom generator
	getDom: function() {

		if ((moment() > this.midnight) || (!this.loaded)) {

			var month = moment().month();
			var year = moment().year();
			var monthName = moment().format("MMMM");
			var monthLength = moment().daysInMonth();

			// Find first day of the month, LOCALE aware
			var startingDay = moment().date(1).weekday();

			var wrapper = document.createElement("table");
			wrapper.className = 'xsmall';
			wrapper.id = 'calendar-table';

			// Create THEAD section with month name and 4-digit year
{'fraction_non_alphanumeric': 0.14799588900308325, 'fraction_numerical': 0.009249743062692703, 'mean_word_length': 3.3111849390919157, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 11, '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': '723946', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1179, 'n_words': 379}