By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,384 Members | 845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,384 IT Pros & Developers. It's quick & easy.

Adding 6 months to the issue date

P: n/a
Hello,
I am trying to automate a date. When typing in the issue date I
want it to automatically calculate 6 months fronm the issue date and
give me the Expiration date. Following is code that I am using:

<td>Visa Issued Date:</td>
<td><input name="visaIssueDate" type="text" size="8"
maxlength="8" value="#DateFormat(get_NamesContacts.VisaIssueDate ,
'mm/dd/yy')#" onBlur="checkDate(this)"></td>
<td>Expiration Date:</td>
<td><input name="visaExpireDate" type="text"
id="visaExpireDate" size="8" maxlength="8"
value="#DateFormat(get_NamesContacts.VisaExpireDat e, 'mm/dd/yy')#"
onBlur="checkDate(this)"></td>
</tr>

I have received feedback regarding what coding to use but it does not
seem to work. I would appreciate it if any one could help.

Thank you
Sandy
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sa**********@yahoo.com (sandy) writes:
I am trying to automate a date. When typing in the issue date I
want it to automatically calculate 6 months fronm the issue date and
give me the Expiration date. Following is code that I am using: .... I have received feedback regarding what coding to use but it does not
seem to work. I would appreciate it if any one could help.


Some of the feedback you received suggested that you decide what "6
months later" is for, e.g., 31th of March or 30th of August. Just adding
six to the month number will give illegal dates (31th of September and
30th of February).

When you have decided what you want the result to be, I'm sure we
can find a way to give it to you.

(I have no idea what the "#"'s are doing in your code, or what the DateFormat function is doing).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
JRS: In article <fb**************************@posting.google.com >, seen
in news:comp.lang.javascript, sandy <sa**********@yahoo.com> posted at
Mon, 19 Jan 2004 05:42:32 :-
I am trying to automate a date. When typing in the issue date I
want it to automatically calculate 6 months fronm the issue date and
give me the Expiration date. Following is code that I am using:

<td>Visa Issued Date:</td>
<td><input name="visaIssueDate" type="text" size="8"
maxlength="8" value="#DateFormat(get_NamesContacts.VisaIssueDate ,
'mm/dd/yy')#" onBlur="checkDate(this)"></td>
<td>Expiration Date:</td>
<td><input name="visaExpireDate" type="text"
id="visaExpireDate" size="8" maxlength="8"
value="#DateFormat(get_NamesContacts.VisaExpireDa te, 'mm/dd/yy')#"
onBlur="checkDate(this)"></td>
</tr>

I have received feedback regarding what coding to use but it does not
seem to work. I would appreciate it if any one could help.


Read the FAQ.

Don't let your news software wrap lines; that mars legibility. Wrap by
hand, with consistent indentation.

If you have control of the system design, change that 6 months to 182
days. Less programming, and has the advantage of going to the same day
of the week - unless you want the next day of the week, when use 183.

The matter was discussed here last week, in a thread "Add six months to
a start date". Some of the solutions given there work well, and the
others have been sufficiently criticised.

Therefore, either you have mis-explained the question, or you have mis-
implemented the solutions given, or the correct answer is not that which
you are expecting, or there is some other difficulty.

We need a clear specification of the intent, including short-month
effects, the smallest code that demonstrates your problem, the results
you get in a given case, and the results you think you should have got.
We may also need to know which browser(s) are being used, and the
version(s).

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.