protected virtual string DateToString(DateTime dateTime) {
if (String.IsNullOrEmpty(this.Format))
return dateTime.ToString(CultureInfo.CurrentUICulture);
try {
return dateTime.ToString(this.Format);
}
catch (FormatException) {
return String.Format("Bad format string '{0}' for value '{1}'", this.Format, dateTime);
}
}