public static object GetAge(object x) { if (ObjectValue.IsDateTime(x)) { return(DateTimeMath.GetAge((DateTime)x)); } return(null); }
public static object GetInterval(object x, object y) { if (ObjectValue.IsDateTime(x, y)) { return(DateTimeMath.getInterval((DateTime)x, (DateTime)y)); } return(null); }
public static object AddYears(object x, object y) { if (!ObjectValue.IsAnyInt(y)) { return(null); } if (ObjectValue.IsDateTime(x)) { return(DateTimeMath.AddYears((DateTime)x, IntValue.ToInt(y))); } return(null); }
public static object AddDays(object x, object y) { if (!ObjectValue.IsAnyDouble(y)) { return(null); } if (ObjectValue.IsDateTime(x)) { return(DateTimeMath.AddDays((DateTime)x, DoubleValue.ToDouble(y))); } return(null); }
public static object GetDays(object x) { if (ObjectValue.IsDateTime(x)) { return(DateTimeMath.GetDays((DateTime)x)); } if (ObjectValue.IsTimeSpan(x)) { return(TimeSpanValue.GetDays((TimeSpan)x)); } return(null); }
public static object Subtract(object x, object y) { if (ObjectValue.IsDateTime(x, y)) { return(DateTimeMath.Subtract((DateTime)x, (DateTime)y)); } if (ObjectValue.IsAnyDouble(x, y)) { return(DoubleMath.Subtract(DoubleValue.ToDouble(x), DoubleValue.ToDouble(y))); } if (ObjectValue.IsAnyDecimal(x, y)) { return(DecimalValue.Subtract(DecimalValue.ToDecimal(x), DecimalValue.ToDecimal(y))); } return(null); }
public static bool IsEqual(object x, object y) { if (ObjectValue.IsDateTime(x, y)) { return(DateTimeMath.IsEqual((DateTime)x, (DateTime)y)); } if (ObjectValue.IsFloat(x, y)) { return(FloatValue.IsAlmost((float)x, (float)y)); } if (ObjectValue.IsDouble(x, y)) { return(DoubleMath.IsAlmost((double)x, (double)y)); } if (ObjectValue.IsDecimal(x, y)) { return(DecimalValue.IsEqual((decimal)x, (decimal)y)); } return(x.Equals(y)); }
public static object Add(object x, object y) { if (ObjectValue.IsBool(x, y)) { return(BooleanValue.Add((bool)x, (bool)y)); } if (ObjectValue.IsString(x, y)) { return(StringValue.Add((string)x, (string)y)); } if (ObjectValue.IsDateTime(x, y)) { return(DateTimeMath.Add((DateTime)x, (DateTime)y)); } if (ObjectValue.IsAnyDouble(x, y)) { return(DoubleMath.Add(DoubleValue.ToDouble(x), DoubleValue.ToDouble(y))); } if (ObjectValue.IsAnyDecimal(x, y)) { return(DecimalValue.Add(DecimalValue.ToDecimal(x), DecimalValue.ToDecimal(y))); } return(null); }