public void ProcessEndEdit(string editedText) { var dates = editedText.Replace(" ", string.Empty) .Split('-'); if (dates.Length == 2 && DateTime.TryParse(dates[0], out DateTime resultD1) && DateTime.TryParse(dates[1], out DateTime resultD2)) { if (resultD1 < resultD2) { picker.ForceDaySelect(resultD1, resultD2); } else { picker.ForceDaySelect(resultD2, resultD1); } } else if (selectedDate1 == null && selectedDate2 == null) { dateInputField.text = defaultText; } else { dateInputField.text = $"{selectedDate1?.ToString("dd/MM/yyyy")} - {selectedDate2?.ToString("dd/MM/yyyy")}"; } }