WARNING: Your browser, IE6, released in 2001 and superseded by IE7 in 2006, is out of date. I advise that you either upgrade to IE7 or switch to a more standards-compliant browser.

Archive for April 2008

DateTime Picker v1.2

Attached is the version 1.2 zip of my datetime picker.

New features include:

  • A start date and end date, for specific dates to start and stop linking.
  • Specific days of the weeks to be unlinked (overrides anything specified in the to be linked array)
  • Specific dates to be unlinked (overrides anything specified in the to be linked array

Also, a few bugs have been fixed.

You can use either the full or compressed versions, both are included in the zip.

Download it here

JavaScript Date/Time Picker

So, I work at People To My Site, as a web developer, specifically using PHP (and dabbling in JavaScript).

We needed a way to choose dates and times, and frankly the choices out there either have too much fluff, or aren’t customizable, or the license isn’t compatible with commercial works. This meant that I had to write one from scratch. I set out, not really sure what I was doing, and just winging it. The result was completely functional, and not half bad if I say so myself.

This didn’t help the community, and I really wanted to give another choice to you developers for this solution until it’s implemented in HTML.

I came home the other day, and decided that since I was bored I would just write another one, this time off company time so it would be my own. I started out kind of slow (I had House of 1000 Corpses on my other monitor, very distracting). Once it was over, however, I really got into it. I hammered out a half-decent framework, stopping to ask for help only once from ##javascript (freenode). What I had was a Version 1.0 release of the code, and with a bit of work it would work well with anybody’s web form. I decided that wasn’t good enough, and reworked it a little bit. What I’ve got now is a Version 1.1 release, which relies 100% (except for the position of the popup) on the external CSS file, and allows a lot more in the way of customizing.

I present to you:

CakePicker 1.1 (I’m terrible at names, so shoot me)

Example

You can use it by including the zipped javascript and css stylesheet, and calling the following function for your onload event:

function init(){
var cal = new dateTimePicker();
cal.linked_days = new Array(0, 1, 2, 4);
cal.linked_dates = new Array(”2008-04-05″, “2008-04-06″);
cal.init();
}

linked_days is the days of the week that will be linked, 0 for Sunday through 6 for Saturday

linked_dates is an array of dates that will be linked, in format YYYY-MM-DD

init() will go through all the input fields that are designated date/time fields and setup the event listeners.

For every input field you want to have the date/time picker attached to it, use the attribute rel=”date”, rel=”time”, or rel=”datetime”

The license simply states: Use it for anything you want, modify it, distribute it, whatever, just keep my header in the JS file.

Enjoy :D

PS: I plan to implement specific dates and days to not be linked, as well as formats to return the times and dates, in the next version. Expect that here soon, I just ran out of time during class today :P

Twitter