Adding 6 months to the issue date

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sandy

    #1

    Adding 6 months to the issue date

    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="visaIssue Date" type="text" size="8"
    maxlength="8" value="#DateFor mat(get_NamesCo ntacts.VisaIssu eDate,
    'mm/dd/yy')#" onBlur="checkDa te(this)"></td>
    <td>Expiratio n Date:</td>
    <td><input name="visaExpir eDate" type="text"
    id="visaExpireD ate" size="8" maxlength="8"
    value="#DateFor mat(get_NamesCo ntacts.VisaExpi reDate, 'mm/dd/yy')#"
    onBlur="checkDa te(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
  • Lasse Reichstein Nielsen

    #2
    Re: Adding 6 months to the issue date

    sandycain001@ya hoo.com (sandy) writes:
    [color=blue]
    > 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:[/color]
    ....[color=blue]
    > 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.[/color]

    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 - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Dr John Stockton

      #3
      Re: Adding 6 months to the issue date

      JRS: In article <fb26f68c.04011 90542.3cc97416@ posting.google. com>, seen
      in news:comp.lang. javascript, sandy <sandycain001@y ahoo.com> posted at
      Mon, 19 Jan 2004 05:42:32 :-
      [color=blue]
      > 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="visaIssue Date" type="text" size="8"
      >maxlength="8 " value="#DateFor mat(get_NamesCo ntacts.VisaIssu eDate,
      >'mm/dd/yy')#" onBlur="checkDa te(this)"></td>
      > <td>Expiratio n Date:</td>
      > <td><input name="visaExpir eDate" type="text"
      >id="visaExpire Date" size="8" maxlength="8"
      >value="#DateFo rmat(get_NamesC ontacts.VisaExp ireDate, 'mm/dd/yy')#"
      >onBlur="checkD ate(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.[/color]

      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.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
      <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

      Comment

      Working...