elfs: (Default)
[personal profile] elfs
If you go look at the Journal Entries Index Page, and you haven't had Java enabled for a long time, you might notice something interesting about the page: the clock has started working again. I've completely re-written the clock in Javascript, which means that it should be accessible to damn near everyone and scales appropriately when applying the Text->Larger option for those whose eyes are getting older.

Just something to share with you before tomorrow's release. And yes, this means that the algorithm is downloadable for those of you able to find your View Source button. It's a complete hack, meant just for this page, and is not to be taken seriously.

If it's borked, obviously, tell me here!

Date: 2006-01-25 01:40 am (UTC)
From: (Anonymous)
Works fine under Firefox 1.5 under Debian Linux. Resizes OK.

Should it match the server-generated version?

Date: 2006-01-25 02:14 am (UTC)
From: [identity profile] bogobob.livejournal.com
I notice that the javascript replaces a static version sent by the server. Should these match up? Because they dont't. In Safari build 417.8 I get:

The time on Pendor is 8:02:39 on Anar, Narrin 18, 0122

But the server says:

24:01:36 on Elenya, Narrin 18, 0122

Different week days on the same day of the month?

Reading through the source it doesn't look like the weekday names start over at the beginning of every month. I remember reading somewhere that they did... Where was that... Everything2 maybe?

Aha, there it is:
http://everything2.com/?node_id=958500

not cannon, but that agrees with the server, the 18th is an Elenya.
From: [identity profile] elfs.livejournal.com
It should match, and I think there's a problem with the day-of-week calculation. (I think it was also broken in the applet.) I'll fix it tomorrow; right now I have two naughty children refusing to get into bed.
From: [identity profile] wookie-cd.livejournal.com
I'm getting "The time on Pendor is 10:33:13 on Anar, Narrin 19, 02022"

My system clock is okay, I'm out of ideas as to how that 19-century gap crept in.. but then it's been too long for me to really understand how that javascript is doing its job.
From: [identity profile] fagricipni.livejournal.com
I can take a pretty good guess as to the 19-century gap. Many programming languages and libraries written in the 20th century only used the last two digits of the year. In order to have the year numbers always increasing and to avoid ambiguity as one enters the second half of the 21th century while remaining compatible with old code, the year value used by the library was respecified as the actual year minus 1900. Probably, Elf's function expects the year-1900 hack, and some browsers are just giving the year. A quick fix would be to compare the browser-given year to 1000, if less than assume the year-1900 hack has already been applied, else assume it has not and apply it yourself. (Though, strictly speaking this "solution" will have changed at least every 1900 years, no matter what value is used for comparison.)

Date: 2006-01-25 02:23 am (UTC)
From: [identity profile] pendorbound.livejournal.com
Nifty! The Java version has always been kind of twitchy on FireFox for the Mac. The JavaScript version doesn't corrupt the screen when I scroll.

Thanks!

Date: 2006-01-25 08:45 am (UTC)
From: [identity profile] hlmt.livejournal.com
*meep* The whole page doesn't even come up!

Date: 2006-01-25 12:29 pm (UTC)
From: [identity profile] hlmt.livejournal.com
Ok, it's coming up now... and the clock works too =)

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 19th, 2025 06:16 am
Powered by Dreamwidth Studios