public override void SetDateTime(DateTime value) { if (fValue != null) { fValue.SetDateTime(value); } else { fValue = new GDMDate(); fValue.Date = value; } }
public override string ParseString(string strValue) { try { if (fValue != null) { fValue.Dispose(); fValue = null; } return(string.IsNullOrEmpty(strValue) ? string.Empty : GEDCOMUtils.ParseDateValue(null, this, strValue)); } catch (Exception ex) { Logger.WriteError("GDMDateValue.ParseString(\"" + strValue + "\")", ex); return(strValue); } }
public override string ParseString(string strValue) { try { if (fValue != null) { fValue.Dispose(); fValue = null; } return(string.IsNullOrEmpty(strValue) ? string.Empty : GEDCOMUtils.ParseDateValue(GetTree(), this, strValue)); } catch (Exception ex) { Logger.LogWrite("GEDCOMDateValue.ParseString(\"" + strValue + "\"): " + ex.Message); return(strValue); } }
public void Test_Misc() { GDMDate dtx1 = new GDMDate(null); dtx1.ParseString("20 JAN 2013"); GDMDate dtx2 = new GDMDate(null); dtx2.ParseString("20 JAN 2014"); var dtA = GDMCustomDate.CreateApproximated(null, dtx1, GDMApproximated.daCalculated); Assert.IsNotNull(dtA); Assert.AreEqual(GDMApproximated.daCalculated, dtA.Approximated); dtA.GetHashCode(); var dtP = GDMCustomDate.CreatePeriod(null, dtx1, dtx2); Assert.IsNotNull(dtP); var dtR = GDMCustomDate.CreateRange(null, dtx1, dtx2); Assert.IsNotNull(dtR); }
public GDMDateValue() { fValue = null; }
/// <summary> /// Internal helper method for parser /// </summary> internal void SetRawData(GDMCustomDate value) { fValue = value; }
public GDMDateValue(GDMObject owner) : base(owner) { fValue = null; }