it's my business, It's my business, my biznass

I just put up a simple python script in projects. It determines if today is a government business day or not.

Listening to: I Saw Her Standing There - Beatles

Del.icio.us | Digg | Technorati | Blinklist | Furl | reddit


comments

Christy says: I'm no coder, but I read your script--I think you need to "re-look" at the Thanksgiving piece. You have: if dayOfWeek == "4": #Thanksgiving if dayOfMonth < "24": print "1" If I've read this right, every Thursday in November before the 24th is a gubmint holiday.
Posted at: 2003-01-14 13:25:34

Rev says: See, proof that open source leads to all bugs being found quickly.
Posted at: 2003-01-14 13:45:34

Christy says: I've been trying to solve "why" for awhile--I'm sure it has something to do with the way you've set up days of the weeks and months, but why don't you need an inclusive time frame for Thanksgiving? It's driving me nuts...
Posted at: 2003-01-14 14:27:34

Rev says: Because it's looking for that last Thursday. > 24 limits the set to seven days, which means only one occurence of Thursday. The weirdness in Feb et al is because I'm looking for the third Monday, not the first or last.
Posted at: 2003-01-14 15:32:34

Christy says: Only it ISN'T the last Thursday, it's normally the 4th Thursday of November. The way I have it figured, the 4th Thursday of November (or any month for that matter) must occur between the 20th and the 26th--in real-days (based on the 1st day of the month being a Sunday and then the 1st day of the month being a Saturday). I'm not trying to second guess your code or anything, but I've been twisting my brain trying to figure out the logic.
Posted at: 2003-01-14 15:47:34

Rev says: Hmmm, I was operating on the assumption that Thanksgiving is the last Thursday in November. I could be wrong in that assumption.
Posted at: 2003-01-14 16:08:34

Christy says: Well, the date is "set" every year, usually in November, by Presidential proclamation but it is normally on the 4th Thursday--
Posted at: 2003-01-14 16:37:34

Christy says: I'll go back to minding my own business now
Posted at: 2003-01-14 18:27:34

Rev says: I appreciate your comments. As it turns out, you are quite right. Code has been modified to look for the 4th Th in November. I really need to clean the code up quite a bit, it's fairly ugly right now ;)
Posted at: 2003-01-15 15:19:34



add a comment

< /p>

(will not be displayed)