Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe a series of dates #13

Open
scichelli opened this issue Dec 28, 2012 · 5 comments
Open

Describe a series of dates #13

scichelli opened this issue Dec 28, 2012 · 5 comments

Comments

@scichelli
Copy link
Contributor

Given a description like "second and fourth Thursdays," I could get the next date in the series, or a collection of the next n dates in the series.

@ChrisMissal
Copy link
Owner

Would the API look something like this:

var startDate = new Date(DateTime.Now);
var datesInSeries = startDate.GetSeries("second and fourth Thursdays");

Or something else @scichelli?

@scichelli
Copy link
Contributor Author

I was imagining:
Date nextDate = startDate.GetNext("second and fourth Thursdays");

and
IEnumerable nextDates = startDate.GetNext("second and fourth Thursdays", 10);

Although... with a "yield return", can you get away with not providing the int parameter, and have it act like an infinite series? Just don't call .Count() on it. :T

@ChrisMissal
Copy link
Owner

Ok, I like that. Is .GetNext() an extension method on .Net's DateTime?

@scichelli
Copy link
Contributor Author

Or a method on the TempusReader.Date class?

@ChrisMissal
Copy link
Owner

I think that's a better start since the API is already based on the TempusReader.Time and TempusReader.Date classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants