Version 1.0
Temporal Toolkit is a library for handling dates & time. It allows you to represent complex recurring time patterns like "the second tuesday of every month at noon except december and october" in code.
The temporal expressions included in Temporal Toolkit are based on a paper by Martin Fowler (http://www.martinfowler.com/apsupp/recurring.pdf) and the ruby runt library (http://www.runt.rubyforge.org)
Requirements:
- Visual Studio 2008
- NUnit
The solution is organized into 2 projects: the toolkit library and the unit tests. Running the unit tests requires NUnit.
To create new temporal expressions just create a class that inherits from the TemporalExpression class.
Add reference to TemporalToolkit.dll to your project.
Add the following to the top of your code:
C#: using TemporalToolkit.TemporalExpressions; VB.NET: Imports TemporalToolkit.TemporalExpressions
Then use operators: & | -
to build temporal expressions.
E.g. Represents first day of every month in the year 2010. TemporalExpression te = new TEYear(2010) & new TEDayOfMonth(DayOfWeek.Monday, 1); Use include to test if your date falls on the specified temporal expression. bool result = te.Includes(new DateTime(2010,1,6));
C#: using TemporalToolkit.Extensions; VB.NET: Imports TemporalToolkit.Extensions;