public override void InitXml(System.Xml.XmlNode node) { base.InitXml(node); m_start = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "start"), DateTimeFormatInfo.InvariantInfo); m_end = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "end"), DateTimeFormatInfo.InvariantInfo); m_type = (DateMatchType)XmlUtils.GetMandatoryIntegerAttributeValue(node, "type"); }
/// <summary> /// Tests if two dates are the same, given a mask as DateMatchType. /// /// ie, 20070605 will match 20070705 if DateMatchType is Day or Year. /// </summary> /// <param name="fulldate">The fulldate in TLDate format (int).</param> /// <param name="matchdate">The matchdate to test against (int).</param> /// <param name="dmt">The "mask" that says what to pay attention to when matching.</param> /// <returns></returns> public static bool TLDateMatch(int fulldate, int matchdate, DateMatchType dmt) { const int d = 0, m = 1, y = 2; if (dmt == DateMatchType.None) { return(false); } bool matched = true; // if we're requesting a day match, if ((dmt & DateMatchType.Day) == DateMatchType.Day) { matched &= TLDateSplit(fulldate)[d] == TLDateSplit(matchdate)[d]; } if ((dmt & DateMatchType.Month) == DateMatchType.Month) { matched &= TLDateSplit(fulldate)[m] == TLDateSplit(matchdate)[m]; } if ((dmt & DateMatchType.Year) == DateMatchType.Year) { matched &= TLDateSplit(fulldate)[y] == TLDateSplit(matchdate)[y]; } return(matched); }
public DateTimeMatcher(DateTime start, DateTime end, DateMatchType type) { m_start = start; m_end = end; m_type = type; IsStartAD = true; IsEndAD = true; UnspecificMatching = false; }
public override void InitXml(System.Xml.XmlNode node) { base.InitXml(node); m_start = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "start"), DateTimeFormatInfo.InvariantInfo); m_end = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "end"), DateTimeFormatInfo.InvariantInfo); m_type = (DateMatchType)XmlUtils.GetMandatoryIntegerAttributeValue(node, "type"); HandleGenDate = XmlUtils.GetOptionalBooleanAttributeValue(node, "genDate", false); IsStartAD = XmlUtils.GetOptionalBooleanAttributeValue(node, "startAD", true); IsEndAD = XmlUtils.GetOptionalBooleanAttributeValue(node, "endAD", true); UnspecificMatching = XmlUtils.GetOptionalBooleanAttributeValue(node, "unspecific", false); }
public DateTimeMatcher(DateTime start, DateTime end, DateMatchType type) { m_start = start; m_end = end; m_type = type; }
/// <summary> /// Tests if two dates are the same, given a mask as DateMatchType. /// /// ie, 20070605 will match 20070705 if DateMatchType is Day or Year. /// </summary> /// <param name="fulldate">The fulldate in TLDate format (int).</param> /// <param name="matchdate">The matchdate to test against (int).</param> /// <param name="dmt">The "mask" that says what to pay attention to when matching.</param> /// <returns></returns> public static bool TLDateMatch(int fulldate,int matchdate, DateMatchType dmt) { const int d = 0, m=1,y=2; if (dmt == DateMatchType.None) return false; bool matched = true; // if we're requesting a day match, if ((dmt & DateMatchType.Day) == DateMatchType.Day) matched &= TLDateSplit(fulldate)[d] == TLDateSplit(matchdate)[d]; if ((dmt & DateMatchType.Month)==DateMatchType.Month) matched &= TLDateSplit(fulldate)[m] == TLDateSplit(matchdate)[m]; if ((dmt & DateMatchType.Year)== DateMatchType.Year) matched &= TLDateSplit(fulldate)[y] == TLDateSplit(matchdate)[y]; return matched; }
/// <summary> /// Adds a single DateFilter /// </summary> /// <param name="date">The date.</param> /// <param name="type">The type.</param> public void DateFilter(int date, DateMatchType type) { datelist.Add(new TLDateFilter(date, type)); }
public TLDateFilter(int date, DateMatchType type) { this.date = date; this.type = type; }
public QlDateFilter(int date, DateMatchType type) { Date = date; Type = type; }
/// <summary> /// Adds a single DateFilter /// </summary> /// <param name="date">The date.</param> /// <param name="type">The type.</param> public void DateFilter(int date, DateMatchType type) { _datelist.Add(new QlDateFilter(date, type)); }