public override decimal ToTimeVariable(TimeVariableType type) { switch (type) { case TimeVariableType.Year: return(time.ToTimeVariable(TimeVariableType.Year)); case TimeVariableType.Month: return(time.ToTimeVariable(TimeVariableType.Month)); case TimeVariableType.Day: return(time.ToTimeVariable(TimeVariableType.Day)); case TimeVariableType.WeekDay: return(DateExtractor.GetWeekDay(ToTime())); case TimeVariableType.Hour: return(clock.ToHour()); case TimeVariableType.Minute: return(clock.ToMinute()); case TimeVariableType.Second: return(clock.ToSecond()); } return(0); }
public override bool ToBool() { bool sameYear = arg0.ToTimeVariable(TimeVariableType.Year) == arg1.ToTimeVariable(TimeVariableType.Year); bool sameMonth = arg0.ToTimeVariable(TimeVariableType.Month) == arg1.ToTimeVariable(TimeVariableType.Month); bool sameDay = arg0.ToTimeVariable(TimeVariableType.Day) == arg1.ToTimeVariable(TimeVariableType.Day); return(sameYear && sameMonth && sameDay); }
public override bool ToBool() { bool sameHour = arg0.ToTimeVariable(TimeVariableType.Hour) == arg1.ToTimeVariable(TimeVariableType.Hour); bool sameMinute = arg0.ToTimeVariable(TimeVariableType.Minute) == arg1.ToTimeVariable(TimeVariableType.Minute); bool sameSecond = arg0.ToTimeVariable(TimeVariableType.Second) == arg1.ToTimeVariable(TimeVariableType.Second); return(sameHour && sameMinute && sameSecond); }