Site Archives

JAVASCRIPT: jQuery zoom event plugin


I don’t normally write code that I’m not ready to use, but I made an exception for this jQuery plugin.  It doesn’t really do all that I wanted it to do, but it’s good enough for a release.

JAVASCRIPT: The start of a jQuery zoom event handler


After much research and very little code, I’ve come up with a basic start to a jQuery zoom event handler.  Don’t laugh.  This is very basic, but it handles zoom events based on keyboard shortcuts and fires the handler.

JAVASCRIPT: Simple date conversion from SQL to readable


I needed a simple date converter function from SQL dates (YYYY-MM-DD) to something readable (M/D/YYYY).  So I wrote this little function.  Maybe someone else will have some use for it.

1
2
3
var makeSQLDatePretty = function(d) {
return d.replace(/([0-9]{4})-0?([0-9]{1,2})-0?([0-9]{1,2})/, ‘$2/$3/$1′);
};

Pass in a SQL date and the function trims leading zeros and returns a reformatted date.

1
2
var sqlDate = [...]