Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,
Datetime can't be change to other format [dd/MM/yyyy] to [MM/dd/yyyy],[yyyy/MM/dd],... like that

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JqueryDate.aspx.cs" Inherits="DtPicker.JqueryDate" %>
 
<!DOCTYPE html>
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
      <title></title>
      <script src="Scripts/jquery-1.7.1.min.js"></script>
      <script src="Scripts/jquery.jdpicker.js"></script>
      <link href="Scripts/jdpicker.css" rel="stylesheet" />
 
</head>
<script type="text/javascript">
//      $(document).ready(function () {
 
//      });     
           
            $("#Country").change(function () {
                  var ddl_value = $('#Country').val();
                  //$("#test1").val(ddl_value);
                  $("#dt").val(ddl_value);
                  location.reload(); // datepicker select to reload
            })
 

            $('#dt').jdPicker({
                  date_format: $("#dt").val()
                  //date_format:"MM dd YYYY"
            })
           
</script>
<body>
      <form id="form1" runat="server">
            <select id="Country">
                  <option value="dd/mm/YYYY">Ind dd/mm/YYYY</option>
                  <option value="FF dd YYYY">Russia FF dd YYYY</option>
                  <option value="dd MM YYYY">Qatar dd MM YYYY</option>
                  <option value="MM dd YYYY">Japan MM dd YYYY</option>
                  <option value="dd FF YYYY">Singapore dd FF YYYY</option>
                  <option value="YYYY/mm/dd">Canada YYYY/mm/dd</option>
            </select>
            <div class="jdpicker_w">
            <p>Date:<input type="text" id="dt" size="30" class="jdpicker"/></p>     
            </div>
      </form>
</body>
</html>


And added this files also,




//============================================================================================
// JS file
//============================================================================================

http://jdpicker.paulds.fr/?p=demo

above the link i am following to this datetime picker

I am using this datetime picker.

Scripts files : Scripts folder inside in this files

jdpicker.css
jquery-1.7.1.min.js
jquery.jdpicker.js

images folder inside this files:

bg_hover.png
bg_selectable.png
bg_selected.png

how to solve this issue?

note:Html format in this file working good.


Thanks,
Karthikeyan,Bangalore
Posted

 
Share this answer
 
Comments
pkarthionline 18-Feb-14 0:46am    
thanks.
but i am currently using Jquery, How to solve in this issue?
V5709 18-Feb-14 4:45am    
check this link.. date strings with java script

http://msdn.microsoft.com/en-us/library/ff743760(v=vs.94).aspx
you can date time conversion by this
http://dpusdc.blogspot.in/[^]


Any question then can ask!
 
Share this answer
 
Comments
pkarthionline 18-Feb-14 0:46am    
thanks Astika.
but i am currently using Jquery, JQuery Dateformat how to make changes to do?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900