Search code examples
datetimepicker

datatimepicker jquery display not correct in localhost


I have setup jquery datetimepicker but it not display correctly in localhost (but online is ok). Picture 1 is datetimepicker localhost, picture 2 is datetimepicker online:

Picture 1

Picture 2

Who have any ideal? Thank you!


Solution

  • Please check whether you have included the below files:

     1. jquery-ui-1.8.custom.css
    
        2. jquery-1.7.1.min.js
    
        3. jquery-ui-1.8.custom.min.js
    

    Sample html code as below:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <title>DistribuTix</title>
    <meta http-equiv="expires" content="">
    <meta http-equiv="ImageToolbar" content="No">
    
    
    
    <link href="css/style.css" rel="stylesheet" type="text/css">
    
    <link rel="stylesheet" media="all" type="text/css" href="css/ui-lightness/jquery-ui-1.8.custom.css" />
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script>
    <style type="text/css">
    
      #ui-datepicker-div{ font-size: 80%; }
    
             /* css for timepicker */
            #ui-timepicker-div dl{ text-align: left; }
            #ui-timepicker-div dl dt{ height: 25px; }
            #ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; }
    
     </style>
    
    </head>
    <body>
    
    
    <input name="eventDate" id="eventDate" maxlength="20" size="17">
    
    
    </body>
    
    <script type="text/javascript">
    $('#eventDate').datepicker({
     dateFormat: 'mm-dd-yy',
     showOn: "button",
     buttonImage: "../images/calendar.gif",
     buttonImageOnly: true
    });
    </script>
    </html>
    

    Also check the included files are in correct path..