DailyJS

DailyJS

The JavaScript blog.


Tagdate-pickers
Featured

jquery forms timers date-pickers

jQuery Roundup: pickadate.js, jQuery Interdependencies, Timer.js

Posted on .

Note: You can send your plugins and articles in for review through our contact form or @dailyjs.

pickadate.js

pickadate.js

pickadate.js (GitHub: amsul / pickadate.js, License: MIT) by Amsul is a date picker that works with type="date" or regular text fields, supports various types of date formatting options, and is easy to theme.

The pickadate.js documentation explains how to use and configure the plugin. Basic usage is just $('.datepicker').datepicker(), given a suitable form field.

jQuery Interdependencies

jQuery Interdependencies (GitHub: miohtama / jquery-interdependencies, License: MIT) by Mikko Ohtamaa is a plugin for expressing relationships between form fields. Rule sets can be created that relate the value of a field to the presence of another field. The simplest example of this would be selecting "Other", and then filling out a value in a text field.

It works with all standard HTML inputs, and can handle nested decision trees. There's also some detailed documentation, jQuery Interdependencies documentation and an introductory blog post that covers the basics.

Timer.js

Florian Schäfer sent in his forked version of jQuery Chrono, Timer.js. It's a periodic timer API for browsers and Node, with some convenience methods and time string expression parsing:

timer.every('2 seconds', function () {});  
timer.after('5 seconds', function () {});  

He also sent in Lambda.js which is a spin-off from Oliver Steele's functional-javascript library. String expressions are used to concisely represent small functions, or lambdas:

lambda('x -> x + 1')(1); // => 2  
lambda('x y -> x + 2*y')(1, 2); // => 5  
lambda('x, y -> x + 2*y')(1, 2); // => 5