Changeset 14080
- Timestamp:
- 07/15/16 10:24:41 (8 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14025,14034
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data/3.3
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Data/3.3 merged: 14025,14034
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data/3.3/TimeSpanValue.cs
r12009 r14080 21 21 22 22 using System; 23 using System.Globalization; 23 24 using System.Text; 24 25 using HeuristicLab.Common; … … 52 53 protected virtual bool Validate(string value, out string errorMessage) { 53 54 TimeSpan val; 54 bool valid = TimeSpan.TryParse (value, out val);55 bool valid = TimeSpan.TryParseExact(value, "c", CultureInfo.CurrentCulture, out val); 55 56 errorMessage = string.Empty; 56 57 if (!valid) { … … 64 65 } 65 66 protected virtual string GetValue() { 66 return Value.ToString( );67 return Value.ToString("c"); 67 68 } 68 69 protected virtual bool SetValue(string value) { 69 70 TimeSpan val; 70 if (TimeSpan.TryParse (value, out val)) {71 if (TimeSpan.TryParseExact(value, "c", CultureInfo.CurrentCulture, out val)) { 71 72 Value = val; 72 73 return true; … … 74 75 return false; 75 76 } 77 } 78 public override string ToString() { 79 return Value.ToString("c"); 76 80 } 77 81
Note: See TracChangeset
for help on using the changeset viewer.