I am way behind on my reading list in google reader (it says 1000+). After reading this:
http://weblogs.asp.net/brijmohan/archive/2008/09/12/javascript-date-comparision-using-customvalidator-and-string-to-date-conversion-using-javascript.aspx
(describing turning the string values of input boxes into date values and then doing a comparison to validate that one is no more than a year from the other)
This could have been a good post if:
- The subject matter was non-trivial.
- The code was internationalized (hence making the subject matter non-trivial).
- There weren't any grammar mistakes.
- And, the calculation was done entirely using Javascript Date objects (instead of the numeric values of those objects)
- Simple date math (Is date 1 within 1 year of date two?) is and should be a trivial problem in any programming language.
- The code provided only works in locales that format their dates like en-GB (dd/mm/yyyy).
- The first 3 lines are not a single sentence; words are spelled wrong; spaces are missing. Also one of the comments makes no sense whatsoever.
var fromDate = new Date();
...
var toDate = new Date();
...
var maxAllowableToDate = fromDate;
maxAllowableToDate.setUTCFullYear(fromDate.getUTCFullYear()+1);
if(fromDate < toDate && toDate < maxAllowableToDate) ...
2 comments:
Hi,
I saw your your post here: http://softwaremaniacs.org/forum/highlightjs/1362/&prev=_t&usg=ALkJrhhsvjrK1nKtuhLIRcDw0yjWpyPGJQ/
about highlight.js and line numbers. I don't know how to contact you directly so sorry I leave a comment here..
Do you still have this files? I would need them too. Or you can post them in your blog ?
Thank you!,
Josefina
no problems, I will put a link up for them after work today (3pm-ish US Mountain time).
Post a Comment