Sorcerer's Tower

Entries tagged "Web Development"

Web Development is essentially anything involving browsers, the related technologies (HTML, CSS, JavaScript), and/or any tools involved for working with them.

It can also involve server-side software such as Apache, Jetty, etc.

Found 8 entries tagged with "webdev", displaying entries 6..8.

View entries: 1..5 6..8

JavaScript Leap Year check

I've just needed to fix a calendar that didn't implement leap years, and thus was missing 29th Feb this year.

Unfortunately, Google was bringing up various functions that rely on how browsers handle oddities in the built-in date functions, which isn't a sensible approach.


So, here is how to do it relying on the leap year formula:

function isLeapYear(year)
{return ((year%4 == 0) && (year%100 != 0 || year%400 == 0));}

And to implement that:

function readDaysInMonth(month,year)
{
	if (month == 1 && isLeapYear(year) == true) return 29;
	else return [31,28,31,30,31,30,31,31,30,31,30,31][month];
}

(Remember, in JS months are 0-indexed, hence 1 = Feb)

cfDevCon 2006

Okay, so I've arrived back from the UK's first* ColdFusion developers' conference (*if you ignore the previous two UK-based CF conferences), and decided I would give my thoughts about it.

Accessibility Is Not CSS!

The biggest barrier to creating an accessible Internet is not browser support or badly designed syntax, but rather people's false beliefs of what accessibility is; what it means to 'be accessible'. For many people, being accessible means switching from font tags to CSS, using em tags for italics, and replacing tables with divs. THAT IS NOT ACCESSIBILITY!

Read on to find out more.