dartemporal 0.0.5

  • README.md
  • Installing
  • Versions
  • 0

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.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dartemporal: ^0.0.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dartemporal/dartemporal.dart';
  
Version Uploaded Documentation Archive
0.0.5 Jun 12, 2016 Go to the documentation of dartemporal 0.0.5 Download dartemporal 0.0.5 archive
0.0.4 Jun 3, 2014 Go to the documentation of dartemporal 0.0.4 Download dartemporal 0.0.4 archive
0.0.3 Jul 18, 2013 Go to the documentation of dartemporal 0.0.3 Download dartemporal 0.0.3 archive
0.0.2 Jul 16, 2013 Go to the documentation of dartemporal 0.0.2 Download dartemporal 0.0.2 archive
0.0.1 Jul 4, 2013 Go to the documentation of dartemporal 0.0.1 Download dartemporal 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 
 Because dartemporal depends on unittest >=0.2.8+2 which requires SDK version <2.0.0, version solving failed.

Health suggestions

Format lib/dartemporal.dart.

Run dartfmt to format lib/dartemporal.dart.

Format lib/exceptions.dart.

Run dartfmt to format lib/exceptions.dart.

Format lib/te_diff.dart.

Run dartfmt to format lib/te_diff.dart.

Fix additional 8 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/te_inrange.dart (Run dartfmt to format lib/te_inrange.dart.)
  • lib/te_intersect.dart (Run dartfmt to format lib/te_intersect.dart.)
  • lib/te_is.dart (Run dartfmt to format lib/te_is.dart.)
  • lib/te_isafter.dart (Run dartfmt to format lib/te_isafter.dart.)
  • lib/te_isbefore.dart (Run dartfmt to format lib/te_isbefore.dart.)
  • lib/te_not.dart (Run dartfmt to format lib/te_not.dart.)
  • lib/te_union.dart (Run dartfmt to format lib/te_union.dart.)
  • lib/texpression.dart (Run dartfmt to format lib/texpression.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Package is too old. (-100 points)

The package was released more than two years ago.

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Add SDK constraint in pubspec.yaml. (-5 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dartemporal.dart.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.