<commit_before>(function (enyo, scope) {
	/**
	* Fires when the picker's value changes.
	*
	* @event moon.DateTimePickerBase#onChange
	* @type {Object}
	* @property {String} name - The name of this control.
	* @property {Date} value - A standard JavaScript {@glossary Date} object representing
	* the picker's current value.
	* @public
	*/

	/**
	* {@link moon.DateTimePickerBase} is a base kind implementing fuctionality shared by
	* {@link moon.DatePicker} and {@link moon.TimePicker}. It is not intended to be used
	* directly.
	*
	* @class moon.DateTimePickerBase
	* @extends moon.ExpandableListItem
	* @ui
	* @protected
	*/

	enyo.kind(
		/** @lends moon.DateTimePickerBase.prototype */ {

		/**
		* @private
		*/
		name: 'moon.DateTimePickerBase',

		/**
		* @private
		*/
		kind: 'moon.ExpandableListItem',

		/**
		* @private
		*/
		defaultKind: 'enyo.Control',

		/**
		* @private
		*/
		classes: 'moon-expandable-picker moon-date-picker',

		/**
		* @private
		*/
		events: {

			/**
			* {@link moon.DateTimePickerBase#onChange}
			*/
			onChange: ''
		},

		/**
		* @private
		*/
		handlers: {
			//* Handler for _onChange_ events coming from constituent controls
			onChange: 'handleChangeEvent'
		},

		/**
		* @private
		* @lends moon.DateTimePickerBase.prototype
		*/
		published: {

			/**
			* Text to be displayed as the current value if no item is currently selected.
			*
			* @type {String}
			* @default ''
			* @public
			*/
			noneText: '',

			/**
			* The locale (in IETF format) used for picker formatting.
			*
			* This setting only applies when the [iLib]{@glossary ilib} library is loaded.
			*
			* When `iLib` is not present, U.S. English `(en-US)` formatting is applied.
			*
			* When `iLib` is present and `locale` is set to the default value `(null)`,
			* the picker uses `iLib`'s current locale (which `iLib` tries to determine
			* from the system).
			*
			* When `iLib` is present and an explicit `locale` is provided, that locale
			* will be used (regardless of `iLib`'s current locale).
			*
			* The `locale` value may be changed after the picker is created; if this happens,
			* the picker will be reformatted to reflect the new setting.
			*
			* @type {Object}
			* @default null
			* @public
			*/
			locale: null,

			/**
			* The value of the picker, expressed as a standard JavaScript {@glossary Date}
			* object.
			*
			* @type {Date}
			* @default null
			* @public
			*/
			value: null,

			/**
			* If `true`, the picker will use a 12-hour clock (this value is ignored when
			* `iLib` is loaded, since the meridiem will be set by the current locale).
			*
			* @type {Boolean}
			* @default false
			* @public
			*/
			meridiemEnable: false
		},

		/**
		* Set in subkind.
		*
		* @private
		*/
		iLibFormatType: null,

		/**
		* Set in subkind.
		*
		* @private
		*/
		defaultOrdering: null,

		/**
		* @private
		*/
		components: [
			{name: 'headerWrapper', kind: 'moon.Item', classes: 'moon-date-picker-header-wrapper', onSpotlightFocus: 'headerFocus', ontap: 'expandContract', components: [
				// headerContainer required to avoid bad scrollWidth returned in RTL for certain text widths (webkit bug)
				{name: 'headerContainer', classes: 'moon-expandable-list-item-header moon-expandable-picker-header moon-expandable-datetime-header', components: [
					{name: 'header', kind: 'moon.MarqueeText'}
				]},
				{name: 'currentValue', kind: 'moon.MarqueeText', classes: 'moon-expandable-picker-current-value'}
			]},
			{name: 'drawer', kind: 'enyo.Drawer', resizeContainer:false, classes:'moon-expandable-list-item-client indented', components: [
				{name: 'client', kind: 'enyo.Control', classes: 'enyo-tool-decorator moon-date-picker-client', onSpotlightLeft:'closePicker', onSpotlightSelect: 'closePicker'}
			]}
		],

		/**
		* @private
		*/
		bindings: [
			{from: '.disabled', to: '.$.headerWrapper.disabled'}
		],

		/**
		* @private
		*/
		create: function () {
			this.inherited(arguments);
			this.createComponent({kind: 'enyo.Signals', onlocalechange: 'handleLocaleChangeEvent'});
			this.initDefaults();
		},

		/**
		* @private
		*/
		initILib: function () {
			var fmtParams = {
				type: this.iLibFormatType,
				useNative: false,
				timezone: 'local',
				length: 'full',
				date: 'dmwy'
			};
			if (this.locale) {
				fmtParams.locale = this.locale;
				this.iLibLocale = null;
				ilib.setLocale(this.locale);
			} else {
				this.iLibLocale = ilib.getLocale();
			}
			this._tf = new ilib.DateFmt(fmtParams);
		},

		/**
		* @private
		*/
		initDefaults: function () {
			var ordering;
			//Attempt to use the ilib lib (assuming that it is loaded)
			if (typeof ilib !== 'undefined') {
				this.initILib();
				ordering = this._tf.getTemplate();
			} else {
				ordering = this.defaultOrdering;
			}
			this.setupPickers(ordering);
			this.noneTextChanged();
		},

		/**
		* @private
		*/
		setupPickers: function (ordering) {
			// implement in subkind, calling this.inherited() at the end
			this.pickers = this.getClientControls();
		},<commit_msg>ENYO-468: Remove conditional related to falsy locale.<commit_after>(function (enyo, scope) {
	/**
	* Fires when the picker's value changes.
	*
	* @event moon.DateTimePickerBase#onChange
	* @type {Object}
	* @property {String} name - The name of this control.
	* @property {Date} value - A standard JavaScript {@glossary Date} object representing
	* the picker's current value.
	* @public
	*/

	/**
	* {@link moon.DateTimePickerBase} is a base kind implementing fuctionality shared by
	* {@link moon.DatePicker} and {@link moon.TimePicker}. It is not intended to be used
	* directly.
	*
	* @class moon.DateTimePickerBase
	* @extends moon.ExpandableListItem
	* @ui
	* @protected
	*/

	enyo.kind(
		/** @lends moon.DateTimePickerBase.prototype */ {

		/**
		* @private
		*/
		name: 'moon.DateTimePickerBase',

		/**
		* @private
		*/
		kind: 'moon.ExpandableListItem',

		/**
		* @private
		*/
		defaultKind: 'enyo.Control',

		/**
		* @private
		*/
		classes: 'moon-expandable-picker moon-date-picker',

		/**
		* @private
		*/
		events: {

			/**
			* {@link moon.DateTimePickerBase#onChange}
			*/
			onChange: ''
		},

		/**
		* @private
		*/
		handlers: {
			//* Handler for _onChange_ events coming from constituent controls
			onChange: 'handleChangeEvent'
		},

		/**
		* @private
		* @lends moon.DateTimePickerBase.prototype
		*/
		published: {

			/**
			* Text to be displayed as the current value if no item is currently selected.
			*
			* @type {String}
			* @default ''
			* @public
			*/
			noneText: '',

			/**
			* The locale (in IETF format) used for picker formatting.
			*
			* This setting only applies when the [iLib]{@glossary ilib} library is loaded.
			*
			* When `iLib` is not present, U.S. English `(en-US)` formatting is applied.
			*
			* When `iLib` is present and `locale` is set to the default value `(null)`,
			* the picker uses `iLib`'s current locale (which `iLib` tries to determine
			* from the system).
			*
			* When `iLib` is present and an explicit `locale` is provided, that locale
			* will be used (regardless of `iLib`'s current locale).
			*
			* The `locale` value may be changed after the picker is created; if this happens,
			* the picker will be reformatted to reflect the new setting.
			*
			* @type {Object}
			* @default null
			* @public
			*/
			locale: null,

			/**
			* The value of the picker, expressed as a standard JavaScript {@glossary Date}
			* object.
			*
			* @type {Date}
			* @default null
			* @public
			*/
			value: null,

			/**
			* If `true`, the picker will use a 12-hour clock (this value is ignored when
			* `iLib` is loaded, since the meridiem will be set by the current locale).
			*
			* @type {Boolean}
			* @default false
			* @public
			*/
			meridiemEnable: false
		},

		/**
		* Set in subkind.
		*
		* @private
		*/
		iLibFormatType: null,

		/**
		* Set in subkind.
		*
		* @private
		*/
		defaultOrdering: null,

		/**
		* @private
		*/
		components: [
			{name: 'headerWrapper', kind: 'moon.Item', classes: 'moon-date-picker-header-wrapper', onSpotlightFocus: 'headerFocus', ontap: 'expandContract', components: [
				// headerContainer required to avoid bad scrollWidth returned in RTL for certain text widths (webkit bug)
				{name: 'headerContainer', classes: 'moon-expandable-list-item-header moon-expandable-picker-header moon-expandable-datetime-header', components: [
					{name: 'header', kind: 'moon.MarqueeText'}
				]},
				{name: 'currentValue', kind: 'moon.MarqueeText', classes: 'moon-expandable-picker-current-value'}
			]},
			{name: 'drawer', kind: 'enyo.Drawer', resizeContainer:false, classes:'moon-expandable-list-item-client indented', components: [
				{name: 'client', kind: 'enyo.Control', classes: 'enyo-tool-decorator moon-date-picker-client', onSpotlightLeft:'closePicker', onSpotlightSelect: 'closePicker'}
			]}
		],

		/**
		* @private
		*/
		bindings: [
			{from: '.disabled', to: '.$.headerWrapper.disabled'}
		],

		/**
		* @private
		*/
		create: function () {
			this.inherited(arguments);
			this.createComponent({kind: 'enyo.Signals', onlocalechange: 'handleLocaleChangeEvent'});
			this.initDefaults();
		},

		/**
		* @private
		*/
		initILib: function () {
			var fmtParams = {
				type: this.iLibFormatType,
				useNative: false,
				timezone: 'local',
				length: 'full',
				date: 'dmwy'
			};

			fmtParams.locale = this.locale;
			this.iLibLocale = null;
			ilib.setLocale(this.locale);
			this._tf = new ilib.DateFmt(fmtParams);
		},

		/**
		* @private
		*/
		initDefaults: function () {
			var ordering;
			//Attempt to use the ilib lib (assuming that it is loaded)
			if (typeof ilib !== 'undefined') {
				this.initILib();
				ordering = this._tf.getTemplate();
			} else {
				ordering = this.defaultOrdering;
			}
			this.setupPickers(ordering);
			this.noneTextChanged();
		},

		/**
		* @private
		*/
		setupPickers: function (ordering) {
			// implement in subkind, calling this.inherited() at the end
			this.pickers = this.getClientControls();
		},
{'fraction_non_alphanumeric': 0.14318430747784527, 'fraction_numerical': 0.0006970028875833914, 'mean_word_length': 2.984133280444268, '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': '4412898', 'n_tokens_mistral': 3972, 'n_tokens_neox': 3311, 'n_words': 889}