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

Support for the TimeSpan datatype #119

Closed
FSMaxB opened this issue Nov 18, 2016 · 5 comments
Closed

Support for the TimeSpan datatype #119

FSMaxB opened this issue Nov 18, 2016 · 5 comments

Comments

@FSMaxB
Copy link

FSMaxB commented Nov 18, 2016

It would be nice if you could add the possibility to schedule jobs to run every TimeSpan using System.TimeSpan.

For example .ToRunEvery(timespan)

@FSMaxB
Copy link
Author

FSMaxB commented Nov 18, 2016

My current workaround:

using System;

namespace FluentScheduler.Extensions
{
    public static class FluentSchedulerExtensions
    {
        ///Schedule a FluentScheduler Job using TimeSpan
        public static SecondUnit ToRunEvery(this Schedule schedule, TimeSpan timespan)
        {
            var seconds = (int)Math.Ceiling(Math.Abs(timespan.TotalSeconds));
            return schedule.ToRunEvery(seconds).Seconds();
        }
    }
}

@tallesl
Copy link
Contributor

tallesl commented Dec 20, 2016

Yeah, I feel you, I had to do something similar one time.

@pujux
Copy link

pujux commented Sep 19, 2018

Has this already been implemented? I know it's been nearly 2 years, but I'd be interested to help!

@VitorCioletti
Copy link

@puf17640 We did not implement that yet, however, I believe it would be a fine overload to implement in the new version of the library.

See #214

VitorCioletti added a commit that referenced this issue Jan 9, 2019
@VitorCioletti
Copy link

Implemented this new feature in redesign branch. It will soon be merged against master.
More info, see #214

@VitorCioletti VitorCioletti self-assigned this Feb 24, 2019
tallesl pushed a commit that referenced this issue May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants