<commit_before>/**
 * jQRangeSlider
 * A javascript slider selector that supports dates
 *
 * Copyright (C) <NAME> 2012
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 */

(function($, undefined){
	"use strict";

	$.widget("ui.dateRangeSliderHandle", $.ui.rangeSliderHandle, {
		_steps: false,

		_getValueForPosition: function(position){
			var min = this.options.bounds.min.valueOf(),
				max = this.options.bounds.max.valueOf();

			if (!this.options.isLeft){
				position += this.cache.width.outer;
			}

			var ratio = (position - this.cache.parent.offset.left) / this.cache.parent.width,
				raw = ratio * (max - min) + min;

			return this._constraintValue(new Date(raw));
		},

		_setOption: function(key, value){
			if (key === "step"){
				this.options.step = value;
				this._createSteps();
				return;
			}

			$.ui.rangeSliderHandle.prototype._setOption.apply(this, [key, value]);
		},
<commit_msg>Update when changing steps for dates<commit_after>/**
 * jQRangeSlider
 * A javascript slider selector that supports dates
 *
 * Copyright (C) <NAME> 2012
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 */

(function($, undefined){
	"use strict";

	$.widget("ui.dateRangeSliderHandle", $.ui.rangeSliderHandle, {
		_steps: false,

		_getValueForPosition: function(position){
			var min = this.options.bounds.min.valueOf(),
				max = this.options.bounds.max.valueOf();

			if (!this.options.isLeft){
				position += this.cache.width.outer;
			}

			var ratio = (position - this.cache.parent.offset.left) / this.cache.parent.width,
				raw = ratio * (max - min) + min;

			return this._constraintValue(new Date(raw));
		},

		_setOption: function(key, value){
			if (key === "step"){
				this.options.step = value;
				this._createSteps();
				this.update();
				return;
			}

			$.ui.rangeSliderHandle.prototype._setOption.apply(this, [key, value]);
		},

{'fraction_non_alphanumeric': 0.1511627906976744, 'fraction_numerical': 0.005285412262156448, 'mean_word_length': 3.464622641509434, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3919517', 'n_tokens_mistral': 709, 'n_tokens_neox': 599, 'n_words': 142}