Dateselect is a time-based job scheduler (like cron). The syntax is build on CSS-like selectors, so it’s easy to use while still being powerfull.
There are instructions on how to use the library and examples on the deployed page.
Basically it’s a library for scheduling tasks, but instead of an ugly cron-syntax my dateselect use css-like selectors.
If you’re interested, check out the tests. Writing tests took quite a lot of time over the node knockout, but was really necessary.
I use jison to parse the CSS-selectors and underscore.js for some array-magic. The deployed site about dateselect is built with socket.io, node-static, 1140 CSS grid, jquery and Google Web Fonts.
Voting is now closed.







(8)
willconantThis is an awesome concept for task scheduling. I love it, and I might even use it in an upcoming project. I’m not entirely sure how to judge a module against a bunch of web apps, so I’m just going with a low design score. | |||
emckeanthis looks great — I would actually use this. Nice use of css syntax. | |||
okaysamuraiI’m not a programmer by trade, but I can get how CSS-style selectors would be great for this sort of thing – particularly to non-code-knowledgeable people like me. Good documentation. A little better page layout and some visuals may have helped make the idea seem more appealing. Nice work! | |||
visnuputility – this type of library is always needed for almost every project I work on. design – I like the approach with the css selector syntax. it’d of course be nice to support the cron syntax also, with possibly a second method (dateselect.cron?) to make the transition for people familiar enough with cron. great use of an API page readme to show off a library submission. innovation – of course, scheduling stuff for later isn’t amazingly innovative and has been done since forever. applying CSS-like syntax is novel, and I give you points for that. multiple worker support or guaranteed timing of execution would’ve definitely gotten you more points. completeness – props on writing a nicely usable (and tested!) library in the 48 hours. | |||
Hi!
Thanks for the feedback. I’ve thought about supporting cron, maybe writing a method that translate a crontab-file to a dateselect-file.
visnupyeah I was thinking the same thing. some of the latest cron syntax can get pretty crazy/powerful though (*/3,6,10).
Yeah, it’ll be a challenge to do a crontab to dateselect implementation, but quite a fun project I think.
Btw, (*/3 6 10) would translate to ‘month.10 day.6 minute:nth(3)’, right?
visnupmore like minute:nth(3), minute.6, minute.10 = “every third minute, every time minute 6 or 10 too.” I think
Ah, that’s true.
wjgilmoreHmm a very interesting idea, I like it! | |||
Thanks for the feedback!
Hey! I really like this project. Pretty clever use of CSS selectors on your part! My only issue is that the documentation/explanation text is somewhat confusing, and contradicting. Not a big issue, though, as this was a 48h project. Some quick comments on the syntax, plus other suggestions:
I think that sums up my comments for now. Keep up the good work! | |||
Hi!
Thanks for your feedaback. Hm, yeah. I guess weekdays could be pseudoclasses, it makes a little bit more sense.
I didn’t have the time to implement an+b-syntax for :nth(), but it’s definitely something that I’ll implement in the future.
Also, I didn’t have time to implement a standalone command line tool. However, it’s in the pipeline!
mapeLove your take on solving this problem. Definitely something I can see myself using in the future. Great job! | |||
Hej! Thanks for the feedback.
remReally like this project. I know it doesn’t make “use of node” per say, but it would be highly useful in long running applications where, say you signed a user up and you wanted to send them a reminder to log in a day later – this library would be really nice to use (over a setTimeout). I think it needs a way of clearing a cronjob, but otherwise useful stuff. | |||
Thanks for the feedback.
I didn’t have time to implement support for clearing a job, but stay tune – it’s definitely something that I’ll implement in the future.
technoweenieNice idea. I had to write a cron-to-english translator because I forget how to use it. Nice extensive tests. | |||
Hi!
Thanks for the feedback. I’m very happy with the tests – thanks for noting that.
I must admit that I don’t really understand it. As I have finally mastered the crontab format, I prefer sticking to that. | |||
The idea is great, but I think I just like the cron syntax. The CSS and HTML based you are proposing seems to me too much work to do the same task, and I do not see it increasing much of the readability, but I may be wrong. | |||
chrismatthieu
jsjohnstNot sure where I will use this and not many will in a straight face saying CSS is “fun” (hence the lower utility/fun score), but innovation is very definitely present. :) Good work and creativity! | |||
It would be cool if you could write modules purely of these time-selectors the same way you write a css file, put them in a directory and each selector would correspond to an event, a server would raise events on some port and perhaps even execute some code. For instance day.weekday hour.7am minute.30 { event-name: ‘cleanup’; module: ‘clean.js’; broadcast: ‘127.0.0.1:1337’; } could be an excellent way to implement a scheduler/time server. Please continue work on this, it could become a useful node module. | |||
Hi!
I love your idea about using css-syntax for the events. I will continue to work on the module, I want it to become useful. Thanks for the feedback!
A rather technical contribution, but a neat one. | |||
jedschmidt+1: a novel take on input for tasks, using a CSS-like syntax. -1: doesn’t really use any of node.js… socket.io is only used for a simple ping/pong demo. tasks are only persisted to memory, which prevents it from being very useful, since everything would get wiped when the process dies. | |||
Thanks for your input!
Good suggestion, I wouldn’t say that the project as it today is isn’t very useful (you just need to save the intervals yourself and then load if the process die) but yes, it’s something that dateselect should take care of.
therazorbladeThis is a neat idea. One thing that’s missing is the ability to name jobs. When I first started reading I though “second” was the job name, then realized its the interval. So next() makes less sense to me now because why do you care about any next task? | |||
Thanks for your input!
I didn’t think about naming the jobs, but it’s a great suggestion. I didn’t implement canceling a job either, and for that a name is definitely needed. The next() is used internally and I thought that there might be a user case where you want to have that info, but maybe it’s unnecessary.
__mario__A nice little utility. | |||
An awesome project to finally fix the broken cron jobs. Very innovative use of css selectors – who would have thought that time was a really good use-case for that?. The API seems clean and solves a single responsibility so this project deserves some attention. | |||
Never seen before! Awesome! Since it’s an app for developer, design is not that important.