loosetime.js provides users with the ability to enter Dates and Times without having to worry about the formatting or navigating a Datetime picker.
Datetime pickers are great for when you don't exactly know what Date or Time you are wanting, however in situations were you know what it is e.g. your date of birth , they can be a right hinderance clicking and navigating to find the right date. loosetime.js lets you just enter the date or time without having to worry.
loosetime.js currently uses 5 parameters for it to work properly:
loosetime("date/time format", "location to append to on DOM", "pre set value", "element name", "class name");
loosetime("HH24:mm:SS", "form1", "15:34:03", "time1", "input_class");
Datetime string components
HH24, HH12, MM, SS, S
DD, mm, YYYY
For the vanilla version:
Download loosetime.js and reference it in your HTML head like so
For the jQuery version:
Download loosetime.jquery.js and reference it along with jQuery 1.9.1 , as below