02.15.06

My foray into the world of open source development

Posted in yahoo, work, web development, ajax, calendar, css, flickr, javascript, web at 1:29 am by admin

All I can say is wow.

When I came to Yahoo! to work on the platform team, I knew that the things I’d be building would be used by sites all over the Yahoo! network, and that kind of exposure was something that both excited me and scared me a little. I’ve built things for people to use before, but never to be consumed by an audience as large as Yahoo!’s.

When I started development on the Calendar component, I had no idea that we were moving in the direction of open-sourcing our platform library. The idea of giving back to the community in this way is something that is personally very satisfying to me, and I think that it will probably help me become a better developer as people begin implementing the things we’ve been working on, and making suggestions that will help us improve them.

It still feels a little strange to me to be able to blog so openly about what I’ve been working on for the few months I’ve been at Yahoo! and reading the incredibly positive feedback that we’ve received from various bloggers is a really exciting and validating experience.

I’m so proud to be working with a team of geniuses that consistently and easily solve complex client-side development problems like they’re nothing. I knew when I came to Yahoo! that I’d be around a lot of really smart folks, but I’m still amazed every day by the people sitting in the cubicles around me, and I would like to take a moment to thank them publicly for continually working so hard to see this vision through.

Those fabulous people are Eric Miraglia, Thomas Sha, Nate Koechley, Matt Sweeney, Adam Moore, Jenny Han, and Todd Kloots — and while their combined knowledge overwhelms me on a regular basis, I don’t think there’s a single day that I don’t learn something from these gurus. Thanks also to Bill Scott, the coolest evangelist since Tammy Faye (with much less makeup).

I’ve posted my first Calendar example here on the site, using the Connection and Event utilities, the Calendar component, and the flickr api. You can check it out here.

Here’s to lots more great stuff to come! )

Tags: , , , , , , , ,

09.09.05

Browser quirk: Safari and the Date object

Posted in web development, calendar, css, javascript, safari at 7:37 pm by admin

While working on some date logic yesterday, I discovered that Safari’s implementation of the JavaScript Date object behaves differently than Internet Explorer, Firefox, Mozilla, Opera, etc.

The great thing about the Date object is that you have the ability to set the fields (month, day, year) to values outside of their prescribed ranges. For instance, month is normally set to a value between 0 and 11. If you create a new date:

var myDate = new Date(2005,13,1);

The resulting date will be February 1, 2006, because the Date object will increment the calendar 2 months into the following year.

The problem in Safari arises when using negative values. Take the code below for example:

var myDate = new Date(2005,-1,1);

In most browsers, this date would evaluate to December 31, 2004. However, Safari refuses to decrement the month field into the previous year, even though it will increment into the next year.

Here’s an example that executes on the page:

var date=new Date(2005,-1,1);document.write(date.toDateString()) (Should show “Wed Dec 01 2004″, but not in Safari!)

This bug appears to only apply to the month field. If you set a negative value into the date field, it will decrement as expected, which is a huge relief since calculating the last day of the previous month can be quite irritating.

The moral of the story is that if your Date addition/subtraction code needs to work in Safari, don’t count on negative month values working the same way that they do in other browsers. If you don’t know this, it could really screw things up.

Tags: , , , ,