public override Net.Vpc.Upa.Types.Temporal ValidateDate(Net.Vpc.Upa.Types.Temporal date) { if (date == null) { return(null); } System.Type type = GetPlatformType(); Net.Vpc.Upa.Types.Calendar c = Net.Vpc.Upa.Types.Calendar.GetInstance(); c.SetTime(date); long time = date.GetTime(); if (typeof(Net.Vpc.Upa.Types.Time).IsAssignableFrom(type)) { return(new Net.Vpc.Upa.Types.Time(time)); } else if (typeof(Net.Vpc.Upa.Types.Time).IsAssignableFrom(type)) { return(new Net.Vpc.Upa.Types.Time(time)); } else if (typeof(Net.Vpc.Upa.Types.Temporal).IsAssignableFrom(type)) { return(new Net.Vpc.Upa.Types.DateTime(time)); } else { throw new Net.Vpc.Upa.Exceptions.IllegalArgumentException(); } }
public Month(Net.Vpc.Upa.Types.Temporal date) : this(date.GetTime()) { }
public DateTime(Net.Vpc.Upa.Types.Temporal date) : base(date.GetTime()) { }
public Timestamp(Net.Vpc.Upa.Types.Temporal date) : this(date.GetTime()) { }
internal static Net.Vpc.Upa.Types.Temporal ParseDate(System.Type type1, Net.Vpc.Upa.Impl.Config.Annotationparser.OverriddenValue <string> @value, Net.Vpc.Upa.Impl.Config.Annotationparser.OverriddenValue <string> format, bool end) /* throws System.Exception */ { string svalue = @value.specified ? @value.@value : null; if (svalue == null) { svalue = ""; } svalue = svalue.Trim(); if ((svalue).Length == 0) { return(null); } string sformat = format.specified ? format.@value : null; if (sformat == null || (sformat.Trim()).Length == 0) { sformat = CreateDateFormatString(type1); } Net.Vpc.Upa.Types.Temporal s = Net.Vpc.Upa.Impl.Util.DateUtils.ParseDateTime(svalue, sformat); if (type1.Equals(typeof(Net.Vpc.Upa.Types.Date))) { return(new Net.Vpc.Upa.Types.Date(s.GetTime())); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.Date))) { return(new Net.Vpc.Upa.Types.Date(s.GetTime())); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.Time))) { return(new Net.Vpc.Upa.Types.Time(s)); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.Time))) { return(new Net.Vpc.Upa.Types.Time(s.GetTime())); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.DateTime))) { return(new Net.Vpc.Upa.Types.DateTime(s)); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.Timestamp))) { return(new Net.Vpc.Upa.Types.Timestamp(s.GetTime())); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.Timestamp))) { return(new Net.Vpc.Upa.Types.Timestamp(s.GetTime())); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.Month))) { return(new Net.Vpc.Upa.Types.Month(s.GetTime())); } else if (type1.Equals(typeof(Net.Vpc.Upa.Types.Year))) { return(new Net.Vpc.Upa.Types.Year(s.GetTime())); } else { return(s); } }