BrightIdeasSoftware.DateTimeClusteringStrategy.DateToString C# (CSharp) Method

DateToString() protected method

Convert the given date into a user presentable string
protected DateToString ( DateTime dateTime ) : string
dateTime DateTime
return string
        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);
            }
        }