Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Javascript

Javascript

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    senthilsstil
    wrote on last edited by
    #1

    Hi Friends, In Javascript i m selecting from date in calendar pop up ,after selecting from date the to date calandar pop up should be increment by 1 day.I m getting error in while i selecting from date as august 2008 7 that is 08/07/2008 the to date calandar popup showing December 7th 2007.Please help me here the code is if(document.getElementById('txt_from_date').value!='') {var d=document.getElementById('txt_from_date').value.split('/'); alert(d); var d1=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); var dat=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); alert('dat:'+ dat);dat.setDate(d1.getDate()+1); var m=(dat.getMonth()+1).toString().length==1?'0'+(dat.getMonth()+1).toString():(dat.getMonth()+1).toString();alert('m:'+ m); var d=dat.getDate().toString().length==1?'0'+dat.getDate().toString():dat.getDate().toString(); alert('d:' +d); var dt=m+'/'+d+'/'+dat.getYear().toString(); cal19.select(document.forms[0].txt_to_date,'anchor19','MM/dd/yyyy', dt); return false; }

    V C N 3 Replies Last reply
    0
    • S senthilsstil

      Hi Friends, In Javascript i m selecting from date in calendar pop up ,after selecting from date the to date calandar pop up should be increment by 1 day.I m getting error in while i selecting from date as august 2008 7 that is 08/07/2008 the to date calandar popup showing December 7th 2007.Please help me here the code is if(document.getElementById('txt_from_date').value!='') {var d=document.getElementById('txt_from_date').value.split('/'); alert(d); var d1=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); var dat=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); alert('dat:'+ dat);dat.setDate(d1.getDate()+1); var m=(dat.getMonth()+1).toString().length==1?'0'+(dat.getMonth()+1).toString():(dat.getMonth()+1).toString();alert('m:'+ m); var d=dat.getDate().toString().length==1?'0'+dat.getDate().toString():dat.getDate().toString(); alert('d:' +d); var dt=m+'/'+d+'/'+dat.getYear().toString(); cal19.select(document.forms[0].txt_to_date,'anchor19','MM/dd/yyyy', dt); return false; }

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      senthilsstil wrote:

      I m getting error

      What is the error?

      Vasudevan Deepak Kumar Personal Homepage
      Tech Gossips
      A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

      S 1 Reply Last reply
      0
      • S senthilsstil

        Hi Friends, In Javascript i m selecting from date in calendar pop up ,after selecting from date the to date calandar pop up should be increment by 1 day.I m getting error in while i selecting from date as august 2008 7 that is 08/07/2008 the to date calandar popup showing December 7th 2007.Please help me here the code is if(document.getElementById('txt_from_date').value!='') {var d=document.getElementById('txt_from_date').value.split('/'); alert(d); var d1=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); var dat=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); alert('dat:'+ dat);dat.setDate(d1.getDate()+1); var m=(dat.getMonth()+1).toString().length==1?'0'+(dat.getMonth()+1).toString():(dat.getMonth()+1).toString();alert('m:'+ m); var d=dat.getDate().toString().length==1?'0'+dat.getDate().toString():dat.getDate().toString(); alert('d:' +d); var dt=m+'/'+d+'/'+dat.getYear().toString(); cal19.select(document.forms[0].txt_to_date,'anchor19','MM/dd/yyyy', dt); return false; }

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        I guess this means your third party calendar control needs to be configured for non US data format ?

        senthilsstil wrote:

        var d1=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1]));

        Surely, swapping the numbers in this line will fix your problem ?

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        • V Vasudevan Deepak Kumar

          senthilsstil wrote:

          I m getting error

          What is the error?

          Vasudevan Deepak Kumar Personal Homepage
          Tech Gossips
          A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

          S Offline
          S Offline
          senthilsstil
          wrote on last edited by
          #4

          Hi Vasudevan Deepak Kumar, When i select August 2008 7th,september,october and november in from date calandar popup,in to date calandar popup its getting selected December 2007 8th.

          1 Reply Last reply
          0
          • S senthilsstil

            Hi Friends, In Javascript i m selecting from date in calendar pop up ,after selecting from date the to date calandar pop up should be increment by 1 day.I m getting error in while i selecting from date as august 2008 7 that is 08/07/2008 the to date calandar popup showing December 7th 2007.Please help me here the code is if(document.getElementById('txt_from_date').value!='') {var d=document.getElementById('txt_from_date').value.split('/'); alert(d); var d1=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); var dat=new Date(parseInt(d[2]), parseInt(d[0])-1, parseInt(d[1])); alert('dat:'+ dat);dat.setDate(d1.getDate()+1); var m=(dat.getMonth()+1).toString().length==1?'0'+(dat.getMonth()+1).toString():(dat.getMonth()+1).toString();alert('m:'+ m); var d=dat.getDate().toString().length==1?'0'+dat.getDate().toString():dat.getDate().toString(); alert('d:' +d); var dt=m+'/'+d+'/'+dat.getYear().toString(); cal19.select(document.forms[0].txt_to_date,'anchor19','MM/dd/yyyy', dt); return false; }

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            senthilsstil wrote:

            I m getting error in while i selecting from date as august 2008 7 that is 08/07/2008 the to date calandar popup showing

            Try installing firebug and debug the error.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups