Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Pop-up Calendar

    I have some script (below) which is returning the date from a pop-up calendar. My problem is that the date is being returned in a dd/mm/yyyy format. However I need to be come back with a dd/mm/yy format. Is there anything simple I can do with the code to achieve this

    function y2k(number) { return (number < 1000) ? number + 1900 : number;

    var today = new Date()
    var day = today.getDate()
    var month = today.getMonth()
    var year = y2k(today.getYear())

    function padout(number) { return (number < 10) ? '0' + number : number;

    function restart()
    document.accounting.date.value = '' + padout(day) +'/' + padout(month - 0 + 1) + '/' + year
    mywindow.close();
    Stephen Cairns Guest

  2. Similar Questions and Discussions

    1. calendar
      How do you place a calendar in forms?
    2. 2006 calendar needed for photo calendar
      I want to start work on a 2006 calendar featuring my own photographs. In Photoshop there used to be a calendar-creating feature that worked well,...
    3. asp calendar
      Can some of you point me to some website with good asp calendars. I did a search on the google but didn't find a whole lot . Thanks
    4. Calendar 9.0
      There are several calendars with the code to do that on my website: http://www.datastrat.com/Download/XCalendar2K.zip and...
    5. calendar asp
      Hello Everyone, I have a calendar http://thehihat.com/calendar/default.asp?month=6&year=2003 What I need to do is be able to add a graphic to the...
  3. #2

    Default Re: Pop-up Calendar

    Stephen Cairns wrote:
    > I have some script (below) which is returning the date from a pop-up
    > calendar. My problem is that the date is being returned in a
    You need to ask this on the .scripting.jscript group.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  4. #3

    Default Re: Pop-up Calendar

    Why not just do something like this:

    dateValue.slice(0, 6) + dateValue.slice(8)

    "Stephen Cairns" <S.Cairns@belfasttelegraph.co.uk> wrote in message
    news:63A11B8E-6422-4355-8D9D-F1DC9692F0F5@microsoft.com...
    > I have some script (below) which is returning the date from a pop-up
    calendar. My problem is that the date is being returned in a dd/mm/yyyy
    format. However I need to be come back with a dd/mm/yy format. Is there
    anything simple I can do with the code to achieve this.
    >
    > function y2k(number) { return (number < 1000) ? number + 1900 :
    number; }
    >
    > var today = new Date();
    > var day = today.getDate();
    > var month = today.getMonth();
    > var year = y2k(today.getYear());
    >
    > function padout(number) { return (number < 10) ? '0' + number : number; }
    >
    > function restart() {
    > document.accounting.date.value = '' + padout(day) +'/' +
    padout(month - 0 + 1) + '/' + year;
    > mywindow.close();

    Raymond D'Anjou \(raydan\) Guest

  5. #4

    Default Re: Pop-up Calendar

    where abouts should I add this piece of code
    Stephen Cairns Guest

  6. #5

    Default Re: Pop-up Calendar

    Kind of depends what you are doing.
    The code I gave you was in javaScript since you posted javaScript code,
    but I would guess from the newsgroup you posted to that you are using ASP to
    write to a database.
    Tell us a bit more of what you are trying to do.

    "Stephen Cairns" <S.Cairns@belfasttelegraph.co.uk> wrote in message
    news:92D859CF-DCBA-4298-883E-5883DA6D3674@microsoft.com...
    > where abouts should I add this piece of code

    Raymond D'Anjou \(raydan\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139