
How a restaurant coupon became an unexpected piece of AZeats technical history
When visitors arrived at AZeats.com in the early 2000s, they could find restaurant information, coupons, gift certificates, virtual tours, menus and other dining resources. One of the site's most useful features was its printable restaurant coupon.
But there was something happening behind the coupon that visitors never saw.
The expiration date was being calculated automatically.
A surviving piece of AZeats source code from the June 3, 2002 homepage reveals a small but clever piece of automation. Rather than manually changing the expiration date every time a coupon was updated, the page used JavaScript to calculate a date 30 days ahead of the visitor's current date.
The code began with:
var AddDays = 30;
It then obtained the visitor's current date, determined the month and day, added 30 days, accounted for the number of days in the month, and generated the text displayed on the page.
The result was visible near the bottom of the June 1, 2002 AZeats homepage:
Coupon Expires...Monday, July 1, 2002
That date was not simply typed into the HTML as a permanent date. It was generated by the code when the page was viewed.
A Simple Form of Web Automation
Today, automatically calculating a date is an almost trivial programming task. In the early years of the commercial Web, however, small pieces of automation like this could make a website considerably easier to maintain.
AZeats offered restaurant coupons as an important part of its dining service. Keeping those coupons current meant that expiration dates had to be managed.
The JavaScript approach reduced the need for someone to manually edit the homepage simply to change an expiration date. The page could calculate a new date based on the visitor's current date.
It was a small feature, but it reflected an important principle behind AZeats: use technology to make the online dining service more useful and easier to maintain.
And Then There Was Y2K
Hidden inside that same piece of code is an even more interesting historical artifact.
The source contains a comment identifying a change as:
"Y2K Fix, Isaac Powell"
The code specifically addresses the way the JavaScript getYear() function handled years before 2000. It checks the returned year and, when necessary, adds 1900 to produce the proper four-digit year.
That may seem insignificant today, but in 1999 it was anything but insignificant.
The transition from December 31, 1999 to January 1, 2000 was one of the most widely discussed technology concerns of the era. Software written when computers commonly represented years with only two digits could potentially interpret "00" incorrectly—as 1900 rather than 2000.
Businesses, governments and technology companies spent years identifying and correcting potential Y2K problems.
AZeats was part of that same technological environment.
The surviving coupon code provides a remarkably small but tangible example of how the Y2K issue reached down into everyday website programming. A piece of JavaScript that primarily existed to calculate a restaurant coupon expiration date also contained a specific correction for the approaching millennium.
The Value of Preserving the Source
A screenshot of the June 2002 AZeats homepage tells us what visitors saw. It shows the restaurant coupon, the expiration date, the site's design and the other information presented to visitors. But the screenshot cannot tell us how the expiration date was produced.
The source code can.
That distinction is one of the reasons preserving the original AZeats material is important.
The visible website tells the story of AZeats as a dining destination. The underlying HTML, JavaScript and graphics can tell a second story—the story of how the website actually worked.
In this case, a few dozen lines of JavaScript reveal both a practical bit of website automation and a glimpse into the technological concerns of the Y2K era.
A Small Piece of a Much Larger Story
The automated coupon system was not revolutionary technology by itself. Nor was the Y2K correction unique to AZeats.
What makes it historically interesting is that the original code survives.
It captures a moment in time when a local Arizona restaurant website was using the emerging capabilities of the Web to automate routine tasks, while at the same time its developers were dealing with one of the defining technology concerns of the late 20th century.
The June 2002 AZeats homepage may have simply looked like a place to find a restaurant coupon.
Behind that coupon was a little piece of programming history.
A screenshot shows us what AZeats looked like. The surviving source code helps show us how it worked.