Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14080


Ignore:
Timestamp:
07/15/16 10:24:41 (8 years ago)
Author:
mkommend
Message:

#2610: Merged r14025, r14034 to stable.

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Data/3.3

  • stable/HeuristicLab.Data/3.3/TimeSpanValue.cs

    r12009 r14080  
    2121
    2222using System;
     23using System.Globalization;
    2324using System.Text;
    2425using HeuristicLab.Common;
     
    5253    protected virtual bool Validate(string value, out string errorMessage) {
    5354      TimeSpan val;
    54       bool valid = TimeSpan.TryParse(value, out val);
     55      bool valid = TimeSpan.TryParseExact(value, "c", CultureInfo.CurrentCulture, out val);
    5556      errorMessage = string.Empty;
    5657      if (!valid) {
     
    6465    }
    6566    protected virtual string GetValue() {
    66       return Value.ToString();
     67      return Value.ToString("c");
    6768    }
    6869    protected virtual bool SetValue(string value) {
    6970      TimeSpan val;
    70       if (TimeSpan.TryParse(value, out val)) {
     71      if (TimeSpan.TryParseExact(value, "c", CultureInfo.CurrentCulture, out val)) {
    7172        Value = val;
    7273        return true;
     
    7475        return false;
    7576      }
     77    }
     78    public override string ToString() {
     79      return Value.ToString("c");
    7680    }
    7781
Note: See TracChangeset for help on using the changeset viewer.