<commit_before>frappe.ui.form.ControlTime = frappe.ui.form.ControlDate.extend({
	set_formatted_input: function(value) {
		this._super(value);
	},
	make_input: function() {
		this.timepicker_only = true;
		this._super();
	},
	make_picker: function() {
		this.set_time_options();
		this.set_datepicker();
		this.refresh();
	},
	set_time_options: function() {
		let sysdefaults = frappe.boot.sysdefaults;

		let time_format = sysdefaults && sysdefaults.time_format
			? sysdefaults.time_format : 'HH:mm:ss';

		this.time_format = frappe.defaultTimeFormat;
		this.datepicker_options = {
			language: "en",
			timepicker: true,
			onlyTimepicker: true,
			timeFormat: time_format.toLowerCase().replace("mm", "ii"),
			startDate: frappe.datetime.now_time(true),
			onSelect: () => {
				// ignore micro seconds
				if (moment(this.get_value(), time_format).format('HH:mm:ss') != moment(this.value, time_format).format('HH:mm:ss')) {
					this.$input.trigger('change');
				}
			},
			onShow: () => {
				$('.datepicker--button:visible').text(__('Now'));

				this.update_datepicker_position();
			},
			keyboardNav: false,
			todayButton: true
		};
	},
	set_input: function(value) {
		this._super(value);
		if (value
			&& ((this.last_value && this.last_value !== this.value)
				|| (!this.datepicker.selectedDates.length))) {

			var date_obj = frappe.datetime.moment_to_date_obj(moment(value, frappe.sys_defaults['time_format']));
			this.datepicker.selectDate(date_obj);
		}
	},
	set_datepicker: function() {
		this.$input.datepicker(this.datepicker_options);<commit_msg>fix: Fallback value for time format<commit_after>frappe.ui.form.ControlTime = frappe.ui.form.ControlDate.extend({
	set_formatted_input: function(value) {
		this._super(value);
	},
	make_input: function() {
		this.timepicker_only = true;
		this._super();
	},
	make_picker: function() {
		this.set_time_options();
		this.set_datepicker();
		this.refresh();
	},
	set_time_options: function() {
		let sysdefaults = frappe.boot.sysdefaults;

		let time_format = sysdefaults && sysdefaults.time_format
			? sysdefaults.time_format : 'HH:mm:ss';

		this.time_format = frappe.defaultTimeFormat;
		this.datepicker_options = {
			language: "en",
			timepicker: true,
			onlyTimepicker: true,
			timeFormat: time_format.toLowerCase().replace("mm", "ii"),
			startDate: frappe.datetime.now_time(true),
			onSelect: () => {
				// ignore micro seconds
				if (moment(this.get_value(), time_format).format('HH:mm:ss') != moment(this.value, time_format).format('HH:mm:ss')) {
					this.$input.trigger('change');
				}
			},
			onShow: () => {
				$('.datepicker--button:visible').text(__('Now'));

				this.update_datepicker_position();
			},
			keyboardNav: false,
			todayButton: true
		};
	},
	set_input: function(value) {
		this._super(value);
		if (value
			&& ((this.last_value && this.last_value !== this.value)
				|| (!this.datepicker.selectedDates.length))) {

			let time_format = frappe.sys_defaults.time_format || 'HH:mm:ss';
			var date_obj = frappe.datetime.moment_to_date_obj(moment(value, time_format));
			this.datepicker.selectDate(date_obj);
		}
	},
	set_datepicker: function() {
		this.$input.datepicker(this.datepicker_options);
{'fraction_non_alphanumeric': 0.16297221354979707, 'fraction_numerical': 0.0, 'mean_word_length': 4.467576791808874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6098047', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1092, 'n_words': 156}