I have this final output:- event.value = (((diffWeeks) + " weeks ") + (diffDays) + " days"); But I want it to read weeks when there are more than one week, and week when it is 0 or 1 week, and similarly for days. Please help. lenpartico
Iguana
9:35 am on Jan 6, 2005 (gmt 0)
How about not trying to do it all on one line?
build up a string and use if DiffWeek>1 to decide whether to add 'weeks' or 'week' to the string
lenpartico
1:50 pm on Jan 6, 2005 (gmt 0)
That is too complex for me. What I have done in the meanwhile is event.value = (((diffWeeks) + " week(s) ") + (diffDays) + " day(s)"); Thanks.
lenpartico
9:32 pm on Jan 6, 2005 (gmt 0)
I'll try it in two parts, but this seems to have a problem.