<commit_before><?php
/**
 * :TODO: reorder components when provided in the wrong order
 */

class FormIOField_Timerange extends FormIOField_DateTime
{
	public $buildString = '<div class="row daterange datetime{$alt? alt}{$classes? $classes}" id="{$id}"{$dependencies? data-fio-depends="$dependencies"}><label for="{$id}_start">{$desc}{$required? <span class="required">*</span>}</label>
									<span style="white-space: nowrap;"><input type="text" name="{$name}[0][0]" id="{$id}_0_date"{$startdate? value="$startdate"} data-fio-type="date" class="date" /> at <input type="text" name="{$name}[0][1]" id="{$id}_0_time"{$starttime? value="$starttime"} data-fio-type="time" class="time" /><select name="{$name}[0][2]" id="{$id}_0_meridian">{$startam?<option value="am" selected="selected">am</option><option value="pm">pm</option>}{$startpm?<option value="am">am</option><option value="pm" selected="selected">pm</option>}</select></span> -
									<span style="white-space: nowrap;"><input type="text" name="{$name}[1][0]" id="{$id}_1_date"{$enddate? value="$enddate"} data-fio-type="date" class="date" /> at <input type="text" name="{$name}[1][1]" id="{$id}_1_time"{$endtime? value="$endtime"} data-fio-type="time" class="time" /><select name="{$name}[1][2]" id="{$id}_1_meridian">{$endam?<option value="am" selected="selected">am</option><option value="pm">pm</option>}{$endpm?<option value="am">am</option><option value="pm" selected="selected">pm</option>}</select></span>
								{$error?<p class="err">$error</p>}<p class="hint">{$hint}</p></div>';

	public static $VALIDATOR_ERRORS = array(
		'timeRangeValidator'=> "Invalid date (dd/mm/yyyy) or time (hh:mm)",
	);

	protected $validators = array(
		'timeRangeValidator'
	);

	public function setValue($value)
	{
		if (is_array($value) && is_array($value[0])) {
			$this->value = $value;
		} else {
			$this->value = array($this->timestampToDateTime($value[0]), $this->timestampToDateTime($value[1]));
		}
	}

	public function getValue()
	{
		$val = $this->getRawValue();
		if ($val === null) {
			return null;
		}
		return array($this->dateTimeToUnix($val[0]), $this->dateTimeToUnix($val[1]));
	}
<commit_msg>wording change to timerange - show 'to' instead of a dash<commit_after><?php
/**
 * :TODO: reorder components when provided in the wrong order
 */

class FormIOField_Timerange extends FormIOField_DateTime
{
	public $buildString = '<div class="row daterange datetime{$alt? alt}{$classes? $classes}" id="{$id}"{$dependencies? data-fio-depends="$dependencies"}><label for="{$id}_start">{$desc}{$required? <span class="required">*</span>}</label>
									<span style="white-space: nowrap;"><input type="text" name="{$name}[0][0]" id="{$id}_0_date"{$startdate? value="$startdate"} data-fio-type="date" class="date" /> at <input type="text" name="{$name}[0][1]" id="{$id}_0_time"{$starttime? value="$starttime"} data-fio-type="time" class="time" /><select name="{$name}[0][2]" id="{$id}_0_meridian">{$startam?<option value="am" selected="selected">am</option><option value="pm">pm</option>}{$startpm?<option value="am">am</option><option value="pm" selected="selected">pm</option>}</select></span> to
									<span style="white-space: nowrap;"><input type="text" name="{$name}[1][0]" id="{$id}_1_date"{$enddate? value="$enddate"} data-fio-type="date" class="date" /> at <input type="text" name="{$name}[1][1]" id="{$id}_1_time"{$endtime? value="$endtime"} data-fio-type="time" class="time" /><select name="{$name}[1][2]" id="{$id}_1_meridian">{$endam?<option value="am" selected="selected">am</option><option value="pm">pm</option>}{$endpm?<option value="am">am</option><option value="pm" selected="selected">pm</option>}</select></span>
								{$error?<p class="err">$error</p>}<p class="hint">{$hint}</p></div>';

	public static $VALIDATOR_ERRORS = array(
		'timeRangeValidator'=> "Invalid date (dd/mm/yyyy) or time (hh:mm)",
	);

	protected $validators = array(
		'timeRangeValidator'
	);

	public function setValue($value)
	{
		if (is_array($value) && is_array($value[0])) {
			$this->value = $value;
		} else {
			$this->value = array($this->timestampToDateTime($value[0]), $this->timestampToDateTime($value[1]));
		}
	}

	public function getValue()
	{
		$val = $this->getRawValue();
		if ($val === null) {
			return null;
		}
		return array($this->dateTimeToUnix($val[0]), $this->dateTimeToUnix($val[1]));
	}

{'fraction_non_alphanumeric': 0.24252112354418817, 'fraction_numerical': 0.010504681434117378, 'mean_word_length': 7.096118299445472, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 95, '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': '1773483', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1490, 'n_words': 254}