It was the 13th hour of the 13th day of the 13th month...
-
threw not throwed FTFY!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
Damn, sorry! I knowed that!
-
Methinks me just threwed up a little bit.
Forgive your enemies - it messes with their heads
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
Second bug in a row... today I wrote "escribido" rather than "escrito" on a SLA proposal... I really need to get some sleep... :sigh:
-
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month... Sigh. :sigh:
the real WTF is, that this may fail in the very rare case, when the year switches between the evaluation of DateTime.Today.Year and DateTime.Today.Month, leading to a primer one year back in the past... but this may not be an issue if the code will not be executed during new years eve ;)
-
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month... Sigh. :sigh:
LOL. *points and laughs loudly at incompetance* No excuses for this one.
-
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month... Sigh. :sigh:
-
You need to convince your employer that their calendars are wrong. Admitting mistakes in code cannot end well.
Hehehe, actually, aside from me being called at 4 A.M., it turned out pretty well for us: the other software company got their asses kicked off of the project, and we already got another project with this customer... So, all in all, it worked for us!
-
Yes, it is bad but understandable. The equivalent of that code works just fine in Excel, for example. Try "=Date(2011,Month(Today())+1,1)" and you get 1/1/2012 which seems sensible to me. It's a coding style I have used for years. No excuses, I'm just saying.
I don't think it's "understandable" when an ASP.Net programmer makes a mistake like this. Presumably they weren't hired for their Excel skills?
-
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month... Sigh. :sigh:
-
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month... Sigh. :sigh:
The coding horror is when you see the same Code Project Discussion two days in a row. That's horrible.
-
DateTime ultimo = primer.AddMonths(1);
ftfy.
-
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month... Sigh. :sigh:
Reminds me of a project I worked on in 1992. I was controlling a piece of hardware which had its own real-time clock. We discovered that it did not handle the rollover for leap year correctly, so we reported a bug to the developer for the firmware on the device. He 'solved' the problem by disallowing setting the date to the month of February :rolleyes:.
Software Zen:
delete this;
-
Reminds me of a project I worked on in 1992. I was controlling a piece of hardware which had its own real-time clock. We discovered that it did not handle the rollover for leap year correctly, so we reported a bug to the developer for the firmware on the device. He 'solved' the problem by disallowing setting the date to the month of February :rolleyes:.
Software Zen:
delete this;
I can see him now... "FIXED!"
-
Hehehe, actually, aside from me being called at 4 A.M., it turned out pretty well for us: the other software company got their asses kicked off of the project, and we already got another project with this customer... So, all in all, it worked for us!
-
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month... Sigh. :sigh: