What is this thing?

This is a library implementing portions of Martin Folwers temporal patterns discussed in this paper: http://martinfowler.com/apsupp/recurring.pdf. It allows for simple implementations of complex recurrence events. This library can be used for calculating recurrance of appointments or events, for testing membership into a complex recurrance range, etc. See example link below to see it in action.

Where can I get it?

It is located in the Dart Pub Directory as dartemporal, or can be found on GitHub at https://github.com/iburton/dartemporal.

How do I use it?

All classes in this library inherit from the TExpression class. They implement the following methods:

  • includes(DateTime date) which allows you to test if a date is included in a Temporal Expression (TE).
  • toString() will give you a rough text output of the defined TE (not yet implemented)
  • first() returns a DateTime object that identifies the start date of the range covered by the TE. Returns null if it is not defined.
  • last() returns a DateTime object that identifies the end date of the range covered by the TE. Returns null if it is not defined.
  • dates() which returns the next n datetimes that match based on a duration and base datetime.
  • Multiple constructors depending on the data type being worked with

An example case can be found here: https://github.com/iburton/DarTemporal/wiki/At-a-glance

The API documentation can be found here: http://iburton.github.io/dartemporal/api/index.html

Exceptions

No custom exceptions are currently defined.

Bugs

Build Status

So you think you found a bug? You are probably right! Please log an issue @ https://github.com/iburton/dartemporal/issues?state=open If you want to provide a test case we can add to the test suite to capture it next time, all the beter. We are using drone.io to continually test the library, the current build test status is above.

TODO

All roadmap items are tracked via github issues @ https://github.com/iburton/dartemporal/issues?state=open

Change Log

  • 0.0.4 (12-Jun-2016) - Tested against Dart 1.17.1, all tests passing

  • 0.0.4 (03-Jun-2014) - Updated for Dart 1.3.6 and unittest 0.11.0+1

  • 0.0.3 (18-Jul-2013) - Added openings() method to allow the location of range

  • 0.0.2 (16-Jul-2013) - Added toJson() methods to all TE's for long term storage - Added fromJson() methods to all TE's to get back TE objects from storage - Revamped test suite to include more robust unit testing and drone.io support

  • 0.0.1 (04-Jul-2013) - Initial Release

Authors and Contributors

To date, all code has been written by Ira Burton (iburton), a very rookie Dart programmer. If something is not working correctly, it is likely because he made some sort of dunderheaded mistake. Please feel free to thoroughly bash him for all mistakes so he can learn the right way to do it. There is no pride of authorship here.

Libraries

dartemporal

A library for the creation and analysis of simple to complex temporal relationships. Use cases include scheduling, date calculations, and time based relationship analysis. The initial concept is based off of Martin Fowlers Recurring Events for Calendars paper, but has since evolved a bit.