<commit_before>/**
 * Copyright (c) 2007 <NAME> (http://www.kelvinluck.com/)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $Id: jquery.datePicker.js 3739 2007-10-25 13:55:30Z kelvin.luck $
 
 * Amends by <NAME> http://m1ke.me
 * Fixes issues with running under jQuery >= 1.7
 ** Corrects "className" attribute to "class"
 ** Uses $.guid for numbering instead of deprecated $.event.guid
 ** We now import the date js file using JSPP
 **/
 
/*> date.js */

(function($){
	$.fn.extend({
/**
 * Render a calendar table into any matched elements.
 * 
 * @param Object s (optional) Customize your calendars.
 * @option Number month The month to render (NOTE that months are zero based). Default is today's month.
 * @option Number year The year to render. Default is today's year.
 * @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback.
 * @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT.
 * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
 * @type jQuery
 * @name renderCalendar
 * @cat plugins/datePicker
 * @author <NAME> (http://www.kelvinluck.com/)
 *
 * @example $('#calendar-me').renderCalendar({month:0, year:2007});
 * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me.
 *
 * @example
 * var testCallback = function($td, thisDate, month, year)
 * {
 * if ($td.is('.current-month') && thisDate.getDay() == 4){
 *		var d = thisDate.getDate();
 *		$td.bind(
 *			'click',
 *			function()
 *			{
 *				alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year);
 *			}
 *		).addClass('thursday');
 *	} else if (thisDate.getDay() == 5){
 *		$td.html('Friday the ' + $td.html() + 'th');
 *	}
 * }
 * $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback});
 * 
 * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text.
 **/
		renderCalendar:function(s){
			var dc = function(a){
				return document.createElement(a);
			};
			s = $.extend({
				month			: null,
				year			: null,
				renderCallback	: null,
				showHeader		: $.dpConst.SHOW_HEADER_SHORT,
				dpController	: null,
				hoverClass		: 'dp-hover'
			}, s);
			
			if (s.showHeader != $.dpConst.SHOW_HEADER_NONE){
				var headRow = $(dc('tr'));
				for (var i=Date.firstDayOfWeek; i<Date.firstDayOfWeek+7; i++){
					var weekday = i%7;
					var day = Date.dayNames[weekday];
					headRow.append(
						jQuery(dc('th')).attr({
							'scope':'col',
							'abbr':day,
							'title':day,
							'class': (weekday == 0 || weekday == 6 ? 'weekend' : 'weekday')
						}).html(s.showHeader == $.dpConst.SHOW_HEADER_SHORT ? day.substr(0, 1) : day)
					);
				}
			};
			
			var calendarTable = $(dc('table')).attr({
				'cellspacing':2,
				'class':'jCalendar'
			}).append((s.showHeader != $.dpConst.SHOW_HEADER_NONE ?  $(dc('thead')).append(headRow) : dc('thead') ) );
			var tbody = $(dc('tbody'));
			
			var today = (new Date()).zeroTime();
			
			var month = s.month == undefined ? today.getMonth() : s.month;
			var year = s.year || today.getFullYear();
			

			// we added the UTC declaration to fix for when clocks go back, however it breaks other timezones
			// so we need a fix that deals with both

			// var currentDate = new Date(year, month, 1);
			var currentDate = new Date(year, month, 1, 12);
			// var currentDate = new Date(Date.UTC(year, month, 1));
			
			
			var firstDayOffset = Date.firstDayOfWeek - currentDate.getDay() + 1;
			if (firstDayOffset > 1){<commit_msg>Better explained problem domain<commit_after>/**
 * Copyright (c) 2007 <NAME> (http://www.kelvinluck.com/)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $Id: jquery.datePicker.js 3739 2007-10-25 13:55:30Z kelvin.luck $
 
 * Amends by <NAME> http://m1ke.me
 * Fixes issues with running under jQuery >= 1.7
 ** Corrects "className" attribute to "class"
 ** Uses $.guid for numbering instead of deprecated $.event.guid
 ** We now import the date js file using JSPP
 **/
 
/*> date.js */

(function($){
	$.fn.extend({
/**
 * Render a calendar table into any matched elements.
 * 
 * @param Object s (optional) Customize your calendars.
 * @option Number month The month to render (NOTE that months are zero based). Default is today's month.
 * @option Number year The year to render. Default is today's year.
 * @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback.
 * @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT.
 * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
 * @type jQuery
 * @name renderCalendar
 * @cat plugins/datePicker
 * @author <NAME> (http://www.kelvinluck.com/)
 *
 * @example $('#calendar-me').renderCalendar({month:0, year:2007});
 * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me.
 *
 * @example
 * var testCallback = function($td, thisDate, month, year)
 * {
 * if ($td.is('.current-month') && thisDate.getDay() == 4){
 *		var d = thisDate.getDate();
 *		$td.bind(
 *			'click',
 *			function()
 *			{
 *				alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year);
 *			}
 *		).addClass('thursday');
 *	} else if (thisDate.getDay() == 5){
 *		$td.html('Friday the ' + $td.html() + 'th');
 *	}
 * }
 * $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback});
 * 
 * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text.
 **/
		renderCalendar:function(s){
			var dc = function(a){
				return document.createElement(a);
			};
			s = $.extend({
				month			: null,
				year			: null,
				renderCallback	: null,
				showHeader		: $.dpConst.SHOW_HEADER_SHORT,
				dpController	: null,
				hoverClass		: 'dp-hover'
			}, s);
			
			if (s.showHeader != $.dpConst.SHOW_HEADER_NONE){
				var headRow = $(dc('tr'));
				for (var i=Date.firstDayOfWeek; i<Date.firstDayOfWeek+7; i++){
					var weekday = i%7;
					var day = Date.dayNames[weekday];
					headRow.append(
						jQuery(dc('th')).attr({
							'scope':'col',
							'abbr':day,
							'title':day,
							'class': (weekday == 0 || weekday == 6 ? 'weekend' : 'weekday')
						}).html(s.showHeader == $.dpConst.SHOW_HEADER_SHORT ? day.substr(0, 1) : day)
					);
				}
			};
			
			var calendarTable = $(dc('table')).attr({
				'cellspacing':2,
				'class':'jCalendar'
			}).append((s.showHeader != $.dpConst.SHOW_HEADER_NONE ?  $(dc('thead')).append(headRow) : dc('thead') ) );
			var tbody = $(dc('tbody'));
			
			var today = (new Date()).zeroTime();
			
			var month = s.month == undefined ? today.getMonth() : s.month;
			var year = s.year || today.getFullYear();
			

			// var currentDate = new Date(year, month, 1);
			// to prevent a problem with daylight savings time we need to set the hour to somewhere in the middle of the day

			var currentDate = new Date(year, month, 1, 12);

			// we previously tried to set to UTC but it conflicted in other areas
			// var currentDate = new Date(Date.UTC(year, month, 1));
			
			
			var firstDayOffset = Date.firstDayOfWeek - currentDate.getDay() + 1;
			if (firstDayOffset > 1){
{'fraction_non_alphanumeric': 0.14207588014127834, 'fraction_numerical': 0.013899965819756182, 'mean_word_length': 3.3933933933933935, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '4573504', 'n_tokens_mistral': 3187, 'n_tokens_neox': 2736, 'n_words': 927}